[thread.req.lockable.general] (original) (raw)
32 Concurrency support library [thread]
32.2 Requirements [thread.req]
32.2.5 Requirements for Cpp17Lockable types [thread.req.lockable]
32.2.5.1 General [thread.req.lockable.general]
An execution agent is an entity such as a thread that may perform work in parallel with other execution agents.
[Note 1:
Implementations or users can introduce other kinds of agents such as processes or thread-pool tasks.
— _end note_]
The calling agent is determined by context, e.g., the calling thread that contains the call, and so on.
[Note 2:
Some lockable objects are “agent oblivious” in that they work for any execution agent model because they do not determine or store the agent's ID (e.g., an ordinary spin lock).
— _end note_]
[Note 3:
The nature of any lock ownership and any synchronization it entails are not part of these requirements.
— _end note_]
A lock on an object m is said to be
- a non-shared lock if it is acquired by a call tolock,try_lock,try_lock_for, ortry_lock_until on m, or
- a shared lock if it is acquired by a call tolock_shared,try_lock_shared,try_lock_shared_for, ortry_lock_shared_until on m.
[Note 4:
Only the method of lock acquisition is considered; the nature of any lock ownership is not part of these definitions.
— _end note_]