http://bugs.winehq.org/show_bug.cgi?id=26500
Vladimir Voznesensky vvoznesensky@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|INVALID |
--- Comment #4 from Vladimir Voznesensky vvoznesensky@gmail.com 2011-03-21 05:00:12 CDT --- (In reply to comment #3)
Besides, critical section implementation uses futexes on Linux to speed up waiting.
Dear Dmitry, I'm sorry. Please, look _carefully_ at pthread_mutex_lock realization. It uses both futexes and events!
Declaration: struct pthread_mutex { long lock; // Exclusive access to mutex state: // 0: unlocked/free // 1: locked - no other waiters // -1: locked - with possible other waiters
long recursion; // Number of unlocks a thread needs to perform // before the lock is released (recursive mutexes only) int kind; // Mutex type pthread_t owner; // Thread owning the mutex handle_t event; // Mutex release notification to waiting threads }; Look here for realization: http://www.jbox.dk/sanos/source/lib/pthread/mutex.c.html#:105
lock variable is used for futex AND event is used for kernel synchronization!