首页 > 代码库 > 状态的所有权
状态的所有权
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.
状态的所有权
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。