Namespaces
Variants

std::mutex:: mutex

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
constexpr mutex ( ) noexcept ;
(1) (C++11부터)
mutex ( const mutex & ) = delete ;
(2) (C++11부터)
1) 뮤텍스를 생성합니다. 생성자가 완료된 후 뮤텍스는 잠금 해제 상태입니다.
2) 복사 생성자가 삭제되었습니다.

매개변수

(없음)

참고 사항

기본 생성자가 constexpr 이므로, 정적 뮤텍스는 정적 비지역 변수 초기화 과정의 일부로 초기화되어 동적 비지역 초기화가 시작되기 전에 준비됩니다. 이로 인해 어떤 정적 객체의 생성자에서도 뮤텍스를 안전하게 잠글 수 있습니다.

참고 항목

C 문서 for mtx_init