Stefan Hajnoczi 2da61b671e rfifolock: add recursive FIFO lock
QemuMutex does not guarantee fairness and cannot be acquired
recursively:

Fairness means each locker gets a turn and the scheduler cannot cause
starvation.

Recursive locking is useful for composition, it allows a sequence of
locking operations to be invoked atomically by acquiring the lock around
them.

This patch adds RFifoLock, a recursive lock that guarantees FIFO order.
Its first user is added in the next patch.

RFifoLock has one additional feature: it can be initialized with an
optional contention callback.  The callback is invoked whenever a thread
must wait for the lock.  For example, it can be used to poke the current
owner so that they release the lock soon.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-03-13 14:42:21 +01:00
..
2013-11-21 08:01:06 -08:00
2014-01-13 14:04:53 +01:00
2013-07-10 13:42:09 -04:00
2013-02-16 11:11:34 +00:00
2013-07-02 08:17:01 +02:00
2014-02-20 13:14:18 +01:00
2014-02-01 13:46:06 +04:00
2014-03-13 14:42:21 +01:00
2013-10-17 17:30:55 +02:00
2013-10-17 17:30:55 +02:00
2014-01-15 23:34:17 +04:00
2014-02-14 16:22:31 +01:00