标签:style color io os ar sp on c ad
A semaphore initialized to one, and which is used such that it only has at most one permit available, can serve as a mutual exclusion
lock. This is more commonly known as a binary semaphore, because it only has two states: one permit available, or zero permits
available. When used in this way, the binary semaphore has the property (unlike many Lock
implementations), that the "lock" can be
released by a thread other than the owner (as semaphores have no notion of ownership). This can be useful in some specialized
contexts, such as deadlock recovery.
标签:style color io os ar sp on c ad
原文地址:http://www.cnblogs.com/yuyutianxia/p/3983507.html