首页 > 代码库 > 并发,互斥,锁。草稿
并发,互斥,锁。草稿
Mutex class
A mutex is a lockable object that is designed to signal when critical sections of code need exclusive access, preventing other threads with the same protection from executing concurrently and access the same memory locations.
mutex objects provide exclusive ownership and do not support recursivity (i.e., a thread shall not lock a mutex it already owns) -- see recursive_mutex for an alternative class that does.
It is guaranteed to be a standard-layout class.
Member types
member type | description |
---|---|
native_handle_type | Type returned by native_handle (only defined if library implementation supports it) |
Member functions
- (constructor)
- Construct mutex (public member function )
- lock
- Lock mutex (public member function )
- try_lock
- Lock mutex if not locked (public member function )
- unlock
- Unlock mutex (public member function )
- native_handle
- Get native handle (public member function )
并发,互斥,锁。草稿
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。