How to write your own condition variable using atomic primitives
<p>I need to write my own implementation of a condition variable much like pthread_cond_t.</p>

<p>I know I'll need to use the compiler provided primitives like __sync_val_compare_and_swap etc.</p>

<p>Does anyone know how I'd go about this please.</p>

<p>Thx</p>
