Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:TimedLockable(since C++11)

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      TheTimedLockable requirements describe the characteristics of types that provide timed exclusive blocking semantics for execution agents (threads, processes, tasks).

      Contents

      [edit]Requirements

      For typeL to beTimedLockable, given

      the following conditions have to be satisfied for an objectm of typeL:

      ExpressionEffectsReturn value
      m.try_lock_for(rel_time)Blocks for the provided durationrel_time or until a lock onm is acquired.true if the lock was acquired,false otherwise.
      m.try_lock_until(abs_time)Blocks until the provided time pointabs_time is reached or a lock onm is acquired.true if the lock was acquired,false otherwise.

      [edit]Notes

      Thetry_lock_for andtry_lock_until member functions obtain a non-shared lock onm on success.

      [edit]Standard library

      The following standard library types satisfyTimedLockable:

      provides mutual exclusion facility which implements locking with a timeout
      (class)[edit]
      provides mutual exclusion facility which can be locked recursively
      by the same thread and implements locking with a timeout
      (class)[edit]
      provides shared mutual exclusion facility and implements locking with a timeout
      (class)[edit]

      [edit]See also

      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/TimedLockable&oldid=177785"

      [8]ページ先頭

      ©2009-2025 Movatter.jp