This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
Section: 32.2.5 [thread.req.lockable], 32.5.4 [thread.mutex.requirements] Status: New Submitter: Agustín K-ballo Bergé Opened: 2016-11-12 Last modified: 2020-05-12
Priority: 3
View all issues with New status.
Discussion:
The current draft contains 14 occurrences of a Return type: clause. That clause is not covered by 16.3.2.4 [structure.specifications] p3. This was reported as editorial request #266.
[Issues Telecon 16-Dec-2016]
Priority 3; Jonathan to provide wording.
[12-May-2020, Jonathan provides wording to correct the 13 occurences.]
Proposed resolution:
This wording is relative to N4681.
Modify 32.2.5.3 [thread.req.lockable.req] as indicated:
-1- A type
Lmeets the Cpp17Lockable requirements if it meets the Cpp17BasicLockable requirements and the following expressions are well-formed, have typebool, and have the specified semantics (mdenotes a value of typeL).
m.try_lock()-2- Effects: [...]
-3- Return type:bool.-4- Returns:
trueif the lock was acquired,falseotherwise.
Modify 32.2.5.4 [thread.req.lockable.timed] as indicated:
-1- A type
Lmeets the Cpp17TimedLockable requirements if it meets the Cpp17BasicLockable requirements and the following expressions are well-formed, have typebool, and have the specified semantics (mdenotes a value of typeL,rel_timedenotes a value of an instantiation ofduration(27.5 [time.duration]), andabs_timedenotes a value of an instantiation oftime_point(27.6 [time.point])).
m.try_lock_for(rel_time)-2- Effects: [...]
-3- Return type:bool.-4- Returns:
trueif the lock was acquired,falseotherwise.
m.try_lock_until(abs_time)-2- Effects: [...]
-3- Return type:bool.-4- Returns:
trueif the lock was acquired,falseotherwise.
Modify 32.5.4.2 [thread.mutex.requirements.mutex] as indicated:
-6- The expression
m.lock()is well-formed, has typevoid, and has the following semantics:-7- Preconditions: [...]
-8- Effects: [...]
-9- Postconditions: [...]
-10- Return type:void.-11- Synchronization: [...]
-12- Throws: [...]
-13- Error conditions: [...]
-14- The expression
m.try_lock()is well-formed, has typebool, and has the following semantics:-15- Preconditions: [...]
-16- Effects: [...]
-17- Return type:bool.-18- Returns:
trueif ownership of the mutex was obtained for the calling thread, otherwisefalse.-19- Synchronization: [...]
-20- Throws: Nothing.
-21- The expression
m.unlock()is well-formed, has typevoid, and has the following semantics:-22- Preconditions: [...]
-23- Effects: [...]
-24- Return type:void.-25- Synchronization: [...]
-26- Throws: Nothing.
Modify 32.5.4.3 [thread.timedmutex.requirements] as indicated:
-1- The timed mutex types are the standard library types [...]
-2- The timed mutex types meet the Cpp17TimedLockable requirements (32.2.5.4 [thread.req.lockable.timed]).
-3- The expression
m.try_lock_for(rel_time)is well-formed, has typebool, and has the following semantics:-4- Preconditions: [...]
-5- Effects: [...]
-6- Return type:bool.-7- Returns:
trueif the shared lock was acquired,falseotherwise.-8- Synchronization: [...]
-9- Throws: [...]
-10- The expression
m.try_lock_until(abs_time)is well-formed, has typebool, and has the following semantics:-11- Preconditions: [...]
-12- Effects: [...]
-13- Return type:bool.-14- Returns:
trueif ownership was obtained, otherwisefalse.-15- Synchronization: [...]
-16- Throws: [...]
Modify 32.5.4.4 [thread.sharedmutex.requirements] as indicated:
-1- The standard library types
shared_mutexandshared_timed_mutexare shared mutex types. [...]-2- In addition to the exclusive lock ownership mode [...]
-3- The expression
m.lock_shared()is well-formed, has typevoid, and has the following semantics:-4- Preconditions: [...]
-5- Effects: [...]
-6- Postconditions: [...]
-7- Return type:void.-8- Synchronization: [...]
-9- Throws: [...]
-10- Error conditions: [...]
-11- The expression
m.unlock_shared()is well-formed, has typevoid, and has the following semantics:-12- Preconditions: [...]
-13- Effects: [...]
-14- Return type:void.-15- Synchronization: [...]
-16- Throws: [...]
-17- The expression
m.try_lock_shared()is well-formed, has typebool, and has the following semantics:-18- Preconditions: [...]
-19- Effects: [...]
-20- Return type:bool.-21- Returns:
trueif the shared ownership lock was acquired,falseotherwise.-22- Synchronization: [...]
-23- Throws: [...]
Modify 32.5.4.5 [thread.sharedtimedmutex.requirements] as indicated:
-1- The standard library type
shared_timed_mutexis a shared timed mutex type. [...]-2- The expression
m.try_lock_shared_for(rel_time)is well-formed, has typebool, and has the following semantics:-3- Preconditions: [...]
-4- Effects: [...]
-5- Return type:bool.-6- Returns:
trueif the shared lock was acquired,falseotherwise.-7- Synchronization: [...]
-8- Throws: [...]
-9- The expression
m.try_lock_shared_until(abs_time)is well-formed, has typebool, and has the following semantics:-10- Preconditions: [...]
-11- Effects: [...]
-12- Return type:bool.-13- Returns:
trueif the shared lock was acquired,falseotherwise.-14- Synchronization: [...]
-15- Throws: [...]