unique_lock::try_lock_for 메서드

연결 된 작업의 소유권을 얻고 mutex 이세요.

template<class Rep,
   class Period>
bool try_lock_for(
   const chrono::duration<Rep,
   Period>& Rel_time
);

매개 변수

  • Rel_time
    A chrono::duration 메서드는 소유권을 가져올 수 시도 하는 시간을 최대 크기를 지정 하는 개체는 mutex.

반환 값

true메서드는 성공적으로 소유권을 얻는 경우는 mutex. 그렇지 않으면 false.

설명

경우 저장 된 mutex 포인터 null, throw는 system_error 오류 코드가 있는 operation_not_permitted.

호출 하는 스레드를 이미 소유 하는 경우는 mutex, throw는 system_error 오류 코드가 있는 resource_deadlock_would_occur.

요구 사항

헤더: 뮤텍스

네임 스페이스: std

참고 항목

참조

unique_lock 클래스

<mutex>