a simple implementation of read/write lock operations
C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
Makefile
README
_rw_locks.c
_rw_locks.h
test.c

README

This is a very simple implementation of the reader/writer lock
implementation written in C using mutexes and condition variables.

The purpose of this was to learn about the mechanics behind thread synchronization.

If you want to use this you have to follow these steps:

-declare a rw_lock_t pointer (struct rw_lock_t *rwvar=NULL)
-initialize the pointer (rw_init(rwvar))
-call rw_readlockr/rw_readunlock/rw_writelock/rw_writeunlock when needed (rw_writelock(rwvar))
-when finished, call rw_destroy to free the allocated memory (rw_destroy(rwvar))

See the file LICENSE for licencing information.