a6dc4412ba
A new locking mechanism: read/write locks When there is a writer it is not possible to put on a read lock or a write lock; when there is a reader it is possible to reenter the read lock but not the write lock. Writers are exclusive locks, readers are shared locks. At the same time through the waiter count to determine whether there is currently a blocked task, if there is then in the unlock time to wake up all the waiter, through the priority of the competition to complete the blocked lock execution. For example: When we have a reader blocking two waiter writers, when the reader is unlocked it wakes up both writers. The writer with higher priority wakes up and checks for a successful condition and locks the lock, the second writer wakes up and fails to check for a condition and continues to block the lock. Signed-off-by: chenrun1 <chenrun1@xiaomi.com> |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Make.defs | ||
sem_clockwait.c | ||
sem_destroy.c | ||
sem_holder.c | ||
sem_initialize.c | ||
sem_post.c | ||
sem_recover.c | ||
sem_reset.c | ||
sem_rw.c | ||
sem_setprotocol.c | ||
sem_tickwait.c | ||
sem_timedwait.c | ||
sem_timeout.c | ||
sem_trywait.c | ||
sem_wait.c | ||
sem_waitirq.c | ||
semaphore.h | ||
spinlock.c |