GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::shared_timed_mutex::lock_shared(3) C++ Standard Libary std::shared_timed_mutex::lock_shared(3)

std::shared_timed_mutex::lock_shared - std::shared_timed_mutex::lock_shared


void lock_shared(); (since C++14)


Acquires shared ownership of the mutex. If another thread is holding the mutex in
exclusive ownership, a call to lock_shared will block execution until shared
ownership can be acquired.


If lock_shared is called by a thread that already owns the mutex in any mode
(exclusive or shared), the behavior is undefined.


If more than the implementation-defined maximum number of shared owners already
locked the mutex in shared mode, lock_shared blocks execution until the number of
shared owners is reduced. The maximum number of owners is guaranteed to be at least
10000.


Prior unlock() operation on the same mutex synchronizes-with (as defined in
std::memory_order) this operation.


(none)


(none)


Throws std::system_error when errors occur, including errors from the underlying
operating system that would prevent lock from meeting its specifications. The mutex
is not locked in the case of any exception being thrown.


lock_shared() is usually not called directly: std::shared_lock is used to manage
shared locking.


This section is incomplete
Reason: no example


lock locks the mutex, blocks if the mutex is not available
(public member function)
tries to lock the mutex for shared ownership, returns if the mutex
try_lock_shared is not available
(public member function)
unlock_shared unlocks the mutex (shared ownership)
(public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.