http://bugs.winehq.org/show_bug.cgi?id=26500
Summary: Critical section busy wait Product: Wine Version: 1.3.16 Platform: All OS/Version: All Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: vvoznesensky@gmail.com
The critical section machinery (EnterCriticalSection, LeaveCriticalSection, TryEnterCriticalSection) is realized suboptimal: waiting thread consumes CPU cycles polling LockCount instead of using system lock like pthread_mutex_lock do (please look at http://www.jbox.dk/sanos/source/lib/pthread/mutex.c.html ) .
Suggested solution: throw out custom realization and use pthread_mutex_t, pthread_mutex_lock, pthread_mutex_unlock and pthread_mutex_lock instead.