标签:必须 order 设置 size dwr thread 详细 ott tchar
|
|
bool
|
wait ( QMutex * mutex, unsigned long time = ULONG_MAX )
|
bool
|
wait ( QReadWriteLock * readWriteLock, unsigned long time = ULONG_MAX )
|
void
|
wakeAll ()
|
void
|
wakeOne ()
|
forever {
mutex.lock();
keyPressed.wait(&mutex);
do_something();
mutex.unlock();
}
forever {
getchar();
keyPressed.wakeAll();
}
forever {
mutex.lock();
keyPressed.wait(&mutex);
++count;
mutex.unlock();
do_something();
mutex.lock();
--count;
mutex.unlock();
}
forever {
getchar();
mutex.lock();
// Sleep until there are no busy worker threads
while (count > 0) {
mutex.unlock();
sleep(1);
mutex.lock();
}
keyPressed.wakeAll();
mutex.unlock();
}
标签:必须 order 设置 size dwr thread 详细 ott tchar
原文地址:http://www.cnblogs.com/findumars/p/7487892.html