1
0
Fork 0
forked from len0rd/rockbox

Add multi-reader, single-writer locks to kernel.

Any number of readers may be in the critical section at a time and writers
are mutually exclusive to all other threads. They are a better choice when
data is rarely modified but often read and multiple threads can safely
access it for reading.

Priority inheritance is fully implemented along with other changes to the
kernel to fully support it on multiowner objects.

This also cleans up priority code in the kernel and updates some associated
structures in existing objects to the cleaner form.

Currently doesn't add the mrsw_lock.[ch] files since they're not yet
needed by anything but the supporting improvements are still useful.

This includes a typed bitarray API (bitarray.h) which is pretty basic
for now.

Change-Id: Idbe43dcd9170358e06d48d00f1c69728ff45b0e3
Reviewed-on: http://gerrit.rockbox.org/801
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
Michael Sevakis 2014-04-24 04:09:18 -04:00
parent 6536f1db3e
commit 533d396761
11 changed files with 880 additions and 601 deletions

View file

@ -143,6 +143,8 @@ extern bool queue_peek(struct event_queue *q, struct queue_event *ev);
#define QPEEK_FILTER_COUNT_MASK (0xffu) /* 0x00=1 filter, 0xff=256 filters */
#define QPEEK_FILTER_HEAD_ONLY (1u << 8) /* Ignored if no filters */
#define QPEEK_REMOVE_EVENTS (1u << 9) /* Remove or discard events */
#define QPEEK_FILTER1(a) QPEEK_FILTER2((a), (a))
#define QPEEK_FILTER2(a, b) (&(const long [2]){ (a), (b) })
extern bool queue_peek_ex(struct event_queue *q,
struct queue_event *ev,
unsigned int flags,