K 10 svn:author V 7 davidxu K 8 svn:date V 27 2010-11-02T06:47:18.115188Z K 7 svn:log V 606 Implement userland sleep queue. The queue is used to eliminate extra context switches and system calls in condition variable use. The problem is pthread_cond_broadcast can cause thread scheduler's thundering hurd, and because a thread calls pthread_cond_signal or pthread_cond_broadcast with mutex locked, resumed thread tries to lock the mutex and is block again, this is extra context switch. The change tries to move sleeping threads from condition variable's wait queue to mutex wait queue, only when the mutex is unlocked, a sleeping thread is woken up, in ideal case, only one system call is needed. END