Files
2025-10-25 03:02:53 +03:00

2.2 KiB

[thread.req.lockable.shared]

32 Concurrency support library [thread]

32.2 Requirements [thread.req]

32.2.5 Requirements for Cpp17Lockable types [thread.req.lockable]

32.2.5.5 Cpp17SharedLockable requirements [thread.req.lockable.shared]

1

#

A type L meets the Cpp17SharedLockable requirements if the following expressions are well-formed, have the specified semantics, and the expression m.try_lock_shared() has type bool (m denotes a value of type L):

🔗

m.lock_shared()

2

#

Effects: Blocks until a lock can be acquired for the current execution agent.

If an exception is thrown then a lock shall not have been acquired for the current execution agent.

🔗

m.try_lock_shared()

3

#

Effects: Attempts to acquire a lock for the current execution agent without blocking.

If an exception is thrown then a lock shall not have been acquired for the current execution agent.

4

#

Returns: true if the lock was acquired, false otherwise.

🔗

m.unlock_shared()

5

#

Preconditions: The current execution agent holds a shared lock on m.

6

#

Effects: Releases a shared lock on m held by the current execution agent.

7

#

Throws: Nothing.