|
Click
|
#include <multithread.hh>
Public Member Functions | |
| rXwlockPW (int32_t max_writers) | |
| void | set_max_writers (int32_t max_writers) |
| void | write_begin () |
| void | write_end () |
| void | write_get () |
| void | read_begin () |
| void | read_end () |
Read XOR Write lock, "prefer write" variant
Allow either multiple reader or multiple writer. When a reader arrives, writers stop taking the usecount. The reader has access once all writer finish.
To stop writer from locking, the reader will CAS a very low value.
If max_writer is 1, this becomes rwlock, but with a priority on the write