码迷,mamicode.com
首页 > 其他好文 > 详细

状态的所有权

时间:2014-09-20 18:29:59      阅读:251      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!