RWLock


Description:

public RWLock ()

Initializes a RWLock so that it can be used.

This function is useful to initialize a lock that has been allocated on the stack, or as part of a larger structure. It is not necessary to initialise a reader-writer lock that has been statically allocated.

  typedef struct {
GRWLock l;
...
} Blob;

Blob *b;

b = g_new (Blob, 1);
g_rw_lock_init (&b->l);

To undo the effect of RWLock when a lock is no longer needed, use g_rw_lock_clear.

Calling RWLock on an already initialized RWLock leads to undefined behaviour.

Parameters:

this

an uninitialized RWLock