mdcore
0.1.5
|
Go to the source code of this file.
Defines | |
#define | INLINE inline |
#define | lock_type volatile int |
#define | lock_init(l) ( *l = 0 ) |
#define | lock_destroy(l) 0 |
#define | lock_trylock(l) ( ( *(l) ) ? 1 : __sync_val_compare_and_swap( l , 0 , 1 ) ) |
#define | lock_unlock(l) ( __sync_val_compare_and_swap( l , 1 , 0 ) != 1 ) |
Functions | |
INLINE int | lock_lock (volatile int *l) |
#define INLINE inline |
#define lock_destroy | ( | l | ) | 0 |
#define lock_init | ( | l | ) | ( *l = 0 ) |
#define lock_trylock | ( | l | ) | ( ( *(l) ) ? 1 : __sync_val_compare_and_swap( l , 0 , 1 ) ) |
#define lock_type volatile int |
#define lock_unlock | ( | l | ) | ( __sync_val_compare_and_swap( l , 1 , 0 ) != 1 ) |