Yabin Cui 76615dae93 Provide writer preference option in rwlock.
Previous implementation of rwlock contains four atomic variables, which
is hard to maintain and change. So I make following changes in this CL:

1. Add pending flags in rwlock.state, so we don't need to synchronize
between different atomic variables. Using compare_and_swap operations
on rwlock.state is enough for all state change.

2. Add pending_lock to protect readers/writers waiting and wake up
operations. As waiting/wakeup is not performance critical, using a
lock is easier to maintain.

3. Add writer preference option.

4. Add unit tests for rwlock.

Bug: 19109156

Change-Id: Idcaa58d695ea401d64445610b465ac5cff23ec7c
2015-04-08 13:11:13 -07:00
..
2015-04-03 10:50:48 -07:00
2014-12-15 18:47:14 -08:00
2014-10-01 11:09:37 -07:00
2015-03-13 10:32:45 -07:00
2015-01-26 11:57:11 -08:00
2015-02-17 19:54:43 -08:00
2014-02-24 20:22:11 +00:00
2015-02-25 19:05:37 -08:00
2014-02-10 13:31:13 -08:00
2014-04-18 21:48:57 +00:00
2014-08-22 10:23:12 -07:00
2015-02-02 09:15:19 -08:00
2014-12-03 15:55:34 -08:00
2015-02-25 14:58:08 -08:00
2010-01-15 15:01:44 -08:00
2014-07-24 14:55:29 -07:00
2014-06-06 16:49:39 -07:00
2014-07-21 17:16:30 -07:00
2014-08-20 10:23:52 -07:00
2015-02-25 15:42:01 -08:00
2010-06-11 14:39:39 -07:00
2014-11-26 17:14:50 -08:00
2014-12-03 15:55:34 -08:00
2014-04-08 19:37:38 -07:00