Namespaces
Variants

std::recursive_timed_mutex:: unlock

From cppreference.net

Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
void unlock ( ) ;
(C++11 이후)

뮤텍스의 소유권 수준이 1 인 경우(이 스레드에서 lock() 호출 횟수가 unlock() 호출 횟수보다 정확히 한 번 더 많음) 뮤텍스를 해제합니다. 그렇지 않은 경우 소유권 수준을 1 감소시킵니다. 뮤텍스는 현재 실행 스레드에 의해 잠겨 있어야 하며, 그렇지 않을 경우 동작은 정의되지 않습니다.

이 연산은 synchronizes-with (다음과 같이 정의됨 std::memory_order ) 동일한 뮤텍스의 소유권을 획득하는 후속 잠금 연산과.

참고 사항

unlock() 는 일반적으로 직접 호출되지 않습니다: std::unique_lock std::lock_guard 가 배타적 잠금을 관리하는 데 사용됩니다.

예제

참고 항목

뮤텍스를 잠금, 뮤텍스를 사용할 수 없는 경우 차단
(public member function)
뮤텍스 잠금을 시도, 뮤텍스를 사용할 수 없는 경우 반환
(public member function)
뮤텍스 잠금을 시도, 지정된 타임아웃 시간 동안
뮤텍스를 사용할 수 없는 경우 반환
(public member function)
뮤텍스 잠금을 시도, 지정된 시간 포인트에 도달할 때까지
뮤텍스를 사용할 수 없는 경우 반환
(public member function)
C documentation for mtx_unlock