QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Typedefs | Functions
lock.h File Reference

Provides a read-write spin lock. More...

#include "qev.h"

Go to the source code of this file.

Typedefs

typedef guint32 qev_lock_t
 Locks are implemented without much ado. More...
 

Functions

void qev_lock_read_lock (qev_lock_t *lock)
 Obtain a read lock.
 
void qev_lock_read_unlock (qev_lock_t *lock)
 Release a read lock.
 
void qev_lock_write_lock (qev_lock_t *lock)
 Obtain a write lock.
 
void qev_lock_write_unlock (qev_lock_t *lock)
 Release a write lock.
 

Detailed Description

Provides a read-write spin lock.

You may either create a a new lock with qev_lock_new/qev_lock_free, or you can allocate it statically/as part of another structure, so long as it's initialized to 0 on creation.

Note
All locking operations issue full memory barriers.
Author
Andrew Stone andre.nosp@m.w@cl.nosp@m.ovar..nosp@m.com

Typedef Documentation

typedef guint32 qev_lock_t

Locks are implemented without much ado.

Literally, just declare this statically or in a larger structure, make sure it's 0, and baby, you got a lock goin'!