If possible, just design your program never to re-lock a mutex it already has.
如果可能,在设计程序时决不要锁定一个已经锁定的互斥量。
Finally, the first thing any thread tries to do when waking up from pthread_cond_wait is re-lock the mutex it unlocked when initially called.
最后,当一个线程从调用pthread_cond_wait而被唤醒时,要做的第一件事就是重新锁定它在最初调用时解锁的那个互斥量。
None of this requires you to actually root the phone, and if you're worried about warranty you can re-lock the handset with the very same code.
本无根,需要你真正的电话,如果您对保修,您可以重新锁定与手机相同的代码非常担心。
应用推荐