template<typename TOwnable, bool TOptional = false>
class alib::lang::OwnerSharedTimed< TOwnable, TOptional >
Similar to class Owner, but calls method TryAcquireSharedTimed instead of Acquire and ReleaseShared instead of Shared. The result is retrievable with the method IsOwning().
- See also
- Chapter 3.3.1 Class Owner And Its Siblings of the Programmer's Manual of module ALib Threads
- Template Parameters
-
| TOwnable | The type to own. Requirements are to have methods TryAcquireSharedTimed and ReleaseShared available. |
| TOptional | If true, then checks is performed, whether the given owned is nulled and thus not acquired and released. If false such checks are omitted. |
Definition at line 582 of file owner.inl.
template<typename TOwnable, bool TOptional = false>
template<typename TTimeValue>
requires TOptional
Sets the ownable after construction. This method is only available if the template parameter TOptional is true. It must not be called if an object was given with construction already, and it must not be called twice. If done, an assertion is raised.
- Parameters
-
| ownable | The ownable to acquire. |
| time | The duration to wait for, or point in time to wait until. |
- Template Parameters
-
| TTimeValue | Type of time parameter accepted with construction and passed to method TOwnable::TryAcquireTimed.
Usually this is type Ticks or Ticks::Duration. |
- Returns
true if the try to acquire the owner was successful, false if not.
Definition at line 671 of file owner.inl.