![]() |
![]() |
![]() |
GNOME Data Access 4 manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations |
GdaLockable; void gda_lockable_lock (GdaLockable *lockable); gboolean gda_lockable_trylock (GdaLockable *lockable); void gda_lockable_unlock (GdaLockable *lockable);
GdaLockable is implemented by GdaSqlParser, GdaVconnectionDataModel, GdaConnection, GdaVirtualConnection and GdaVconnectionHub.
void gda_lockable_lock (GdaLockable *lockable);
Locks lockable
. If it is already locked by another thread, the current thread will block until it 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()
, this method recursive, which means a thread can lock lockable
several times
(and has to unlock it as many times to actually unlock it).
|
a GdaLockable object. |
gboolean gda_lockable_trylock (GdaLockable *lockable);
Tries to lock lockable
. If it is already locked by another thread, then it immediately returns FALSE, otherwise
it locks lockable
.
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()
, this method recursive, which means a thread can lock lockable
several times
(and has to unlock it as many times to actually unlock it).
|
a GdaLockable object. |
Returns : |
TRUE if the object has successfully been locked. |
void gda_lockable_unlock (GdaLockable *lockable);
Unlocks lockable
. This method should not be called if the current does not already holds a lock on lockable
(having
used gda_lockable_lock()
or gda_lockable_trylock()
).
This function can be used even if g_thread_init()
has not yet been called, and, in that case, will do nothing.
|
a GdaLockable object. |