1 #include "lsl_protos.h"
4 #define RW_LOCK_BIAS 0x001000
6 /** Example implementation of linux rw lock along with 2 thread test
9 typedef struct rwlock {
14 void lock_init(rwlock_t *lock) {
18 int write_trylock(rwlock_t *rw) {
19 return lsl_cas_32(&rw->lock, 0, 1);
23 void write_unlock(rwlock_t *rw) {
27 void foo(rwlock_t *mylock) {
28 int flag=write_trylock(mylock);
34 void bar(rwlock_t *mylock)
36 for(int i=0;i<PROBLEMSIZE;i++)