[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/thread/unique_lock/unique_lock [Back]  [Original]

std::unique_lock::unique_lock cppreference.com
cppreference.com

std::unique_lock::unique_lock

cppreference.com

<metanoindex/>

 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++11)
(C++20)
(C++20)
this_thread
(C++11)
(C++11)
(C++11)
(C++11)
(C++20)
(C++11)( C++20)
(C++11)( C++20)
(C++11)( C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
 
 
<tbody> </tbody>
unique_lock();
(1) ( C++11)
unique_lock( unique_lock&& other );
(2) ( C++11)
explicit unique_lock( mutex_type& m );
(3) ( C++11)
unique_lock( mutex_type& m, std::defer_lock_t t );
(4) ( C++11)
unique_lock( mutex_type& m, std::try_to_lock_t t );
(5) ( C++11)
unique_lock( mutex_type& m, std::adopt_lock_t t );
(6) ( C++11)
template< class Rep, class Period > unique_lock( mutex_type& m, const std::chrono::duration<Rep,Period>& timeout_duration );
(7) ( C++11)
template< class Clock, class Period > unique_lock( mutex_type& m, const std::chrono::time_point<Clock,Duration>& timeout_time );
(8) ( C++11)
unique_lock, .
:
Constructs a unique_lock, optionally locking the supplied mutex.
Google.
. .

1)

unique_lock, .
:
Constructs a unique_lock with no associated mutex.
Google.
. .

2)

. unique_lock other.
:
Move constructor. Initializes the unique_lock with the contents of other.
Google.
. .

3-8)

unique_lock m . :
:
Constructs a unique_lock with m as the associated mutex. Additionally:
Google.
. .
3)
m.lock().
:
Locks the associated mutex by calling m.lock().
Google.
. .
4)
.
:
Does not lock the associated mutex.
Google.
. .
5)
m.try_lock().
:
Tries to lock the associated mutex without blocking by calling m.try_lock().
Google.
. .
6)
, m.
:
Assumes the calling thread already owns m.
Google.
. .
7)
. timeout_duration , . , timeout_duration.
:
Tries to lock the associated mutex. Blocks until specified timeout_duration has elapsed or the lock is acquired, whichever comes first. May block for longer than timeout_duration.
Google.
. .
8)
. timeout_time , . , timeout_time .
:
Tries to lock the associated mutex. Blocks until specified timeout_time has been reached or the lock is acquired, whichever comes first. May block for longer than until timeout_time has been reached.
Google.
. .

other
unique_lock
:
another unique_lock to initialize the state with
Google.
. .
m
, , ,
:
mutex to associate with the lock and optionally acquire ownership of
Google.
. .
t
:
tag parameter used to select constructors with different locking strategies
Google.
. .
timeout_duration
:
maximum duration to block for
Google.
. .
timeout_time
,
:
maximum time point to block until
Google.
. .

1, 2, 4)

noexcept:  
noexcept
  


Web Proxy Viewer  |  New URL  |  Original Page