A simple R/W lock using pthreads/gcc atomics