* reader_count was not incremented when a waiting reader was woken up.

* Added comment clarifying the use of reader_count and writer_count.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25474 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-12 17:22:16 +00:00
parent f1a950f7bf
commit 7c3137b98b

View File

@ -95,6 +95,9 @@ struct LocalRWLock {
int32_t lock_count;
int32_t reader_count;
int32_t writer_count;
// Note, that reader_count and writer_count are not used the same way.
// writer_count includes the write lock owner as well as waiting
// writers. reader_count includes read lock owners only.
WaiterList waiters;
status_t Init()
@ -245,6 +248,7 @@ private:
if (waiter->userThread->wait_status > 0) {
waiter->userThread->wait_status = B_OK;
readers[readerCount++] = waiter->thread;
reader_count++;
}
}