在线文档教程

Mutex

C++ concepts: Mutex

The Mutex concept extends the Lockable concept to include inter-thread synchronization.

Requirements

  • Lockable

For object m of Mutex type.

  • The expression m.lock() has the following properties

std::errc::device_or_resource_busy if the mutex is already locked(until C++17)

  • std::errc::device_or_resource_busy if the mutex is already locked

(until C++17)

  • The expression m.try_lock() has the following properties

Library types

The following standard library types satisfy Mutex:

  • std::mutex

See also

  • Thread support library

© cppreference.com

Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.

http://en.cppreference.com/w/cpp/concept/Mutex