| GNOME Data Access 5 manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
GdaMutex; GdaMutex * gda_mutex_new (void); void gda_mutex_lock (GdaMutex *mutex); gboolean gda_mutex_trylock (GdaMutex *mutex); void gda_mutex_unlock (GdaMutex *mutex); void gda_mutex_free (GdaMutex *mutex);
GdaMutex * gda_mutex_new (void);
Creates a new GdaMutex.
Note: Unlike g_mutex_new(), this function will return NULL if g_thread_init() has not been called yet.
Returns : |
a new GdaMutex. [transfer full] |
void gda_mutex_lock (GdaMutex *mutex);
Locks mutex. If mutex is already locked by another thread, the current thread will block until mutex is unlocked by the other thread.
This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.
Note: unlike g_mutex_lock(), the GdaMutex is recursive, which means a thread can lock it several times (and has
to unlock it as many times to actually unlock it).
|
a GdaMutex |
gboolean gda_mutex_trylock (GdaMutex *mutex);
Tries to lock mutex. If mutex is already locked by another thread, it immediately returns FALSE.
Otherwise it locks mutex and returns TRUE
This function can be used even if g_thread_init() has not yet been called, and, in that case, will immediately return TRUE.
Note: Unlike g_mutex_trylock(), the GdaMutex is recursive, which means a thread can lock it several times (and has
to unlock it as many times to actually unlock it)
|
a GdaMutex |
Returns : |
TRUE, if mutex could be locked. |
void gda_mutex_unlock (GdaMutex *mutex);
Unlocks mutex. If another thread is blocked in a gda_mutex_lock() call for mutex, it wil
be woken and can lock mutex itself.
This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.
|
a GdaMutex |
void gda_mutex_free (GdaMutex *mutex);
Destroys mutex.
|
a GdaMutex. [transfer full] |