Represents a synchronization primitive that is signaled when its count reaches zero.
Public Constructors | |
| countdown_event (xtd::size initial_count) | |
| Initializes a new instance of xtd::threading::countdown_event class with the specified count. | |
Public Properties | |
| auto | current_count () const -> xtd::size |
| Gets the number of remaining signals required to set the event. | |
| auto | initial_count () const -> xtd::size |
| Gets the numbers of signals initially required to set the event. | |
| auto | is_set () const -> bool |
| ndicates whether the xtd::threading::countdown_event object's current count has reached zero. | |
| auto | wait_handle () const -> const xtd::threading::wait_handle & |
| Gets a xtd::threading::wait_handle that is used to wait for the event to be set. | |
| auto | wait_handle () -> xtd::threading::wait_handle & |
| Gets a xtd::threading::wait_handle that is used to wait for the event to be set. | |
Public Methods | |
| auto | add_count () -> void |
| Increments the xtd::threading::countdown_event's current count by one. | |
| auto | add_count (xtd::size count) -> void |
| Increments the xtd::threading::countdown_event's current count by one. | |
| auto | close () -> void |
| Close the current instance of the xtd::threading::countdown_event class. | |
| auto | reset () -> void |
| Resets the xtd::threading::countdown_event to the value of xtd::threading::countdown_event::initial_count. | |
| void | reset (xtd::size count) |
| Resets the xtd::threading::countdown_event::initial_count property to a specified value. | |
| auto | signal () -> bool |
| Registers a signal with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count. | |
| auto | signal (xtd::size signal_count) -> bool |
| Registers multiple signals with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count by the specified amount. | |
| auto | try_add_count () noexcept -> bool |
| Attempts to increment xtd::threading::countdown_event::current_count by one. | |
| auto | try_add_count (xtd::size count) noexcept -> bool |
| Attempts to increment xtd::threading::countdown_event::current_count by by a specified value. | |
| auto | wait () -> void |
| Blocks the current thread until the xtd::threading::countdown_event is set. | |
| auto | wait (xtd::int32 milliseconds_timeout) -> bool |
| Blocks the current thread until the xtd::threading::countdown_event is set, using a 32-bit signed integer to measure the timeout. | |
| auto | wait (const cancellation_token &cancellation_token) -> void |
| Blocks the current thread until the xtd::threading::countdown_event is set, while observing a xtd::threading::cancellation_token. | |
| auto | wait (const xtd::time_span &timeout) -> bool |
| Blocks the current thread until the xtd::threading::countdown_event is set, using a xtd::time_span to measure the timeout. | |
| auto | wait (xtd::int32 milliseconds_timeout, const cancellation_token &cancellation_token) -> bool |
| Blocks the current thread until the xtd::threading::countdown_event is set, using a 32-bit signed integer to measure the timeout, while observing a xtd::threading::cancellation_token. | |
| auto | wait (const xtd::time_span &timeout, const cancellation_token &cancellation_token) -> bool |
| Blocks the current thread until the xtd::threading::countdown_event is set, using a xtd::time_span to measure the timeout, while observing a xtd::threading::cancellation_token. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. | |
| virtual xtd::size | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. | |
| template<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| virtual xtd::string | to_string () const |
| Returns a xtd::string that represents the current object. | |
| template<class object_a_t, class object_b_t> | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal. | |
| template<class object_a_t, class object_b_t> | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance. | |
|
explicit |
Initializes a new instance of xtd::threading::countdown_event class with the specified count.
| initial_count | he number of signals initially required to set the xtd::threading::countdown_event. |
| xtd::argument_out_of_range_exception | initial_count is less than 0. |
|
nodiscard |
Gets the number of remaining signals required to set the event.
| xtd::object_closed_exception | The current instance has already been closed. |
|
nodiscard |
Gets the numbers of signals initially required to set the event.
| xtd::object_closed_exception | The current instance has already been closed. |
|
nodiscard |
ndicates whether the xtd::threading::countdown_event object's current count has reached zero.
true if the current count is zero; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
true.
|
nodiscard |
Gets a xtd::threading::wait_handle that is used to wait for the event to be set.
| xtd::object_closed_exception | The current instance has already been closed. |
|
nodiscard |
Gets a xtd::threading::wait_handle that is used to wait for the event to be set.
| xtd::object_closed_exception | The current instance has already been closed. |
| auto xtd::threading::countdown_event::add_count | ( | ) | -> void |
Increments the xtd::threading::countdown_event's current count by one.
| xtd::object_closed_exception | The current instance has already been closed. |
| xtd::invalid_operation_exception | The current instance is already set. |
| auto xtd::threading::countdown_event::add_count | ( | xtd::size | count | ) | -> void |
Increments the xtd::threading::countdown_event's current count by one.
| count | The value by which to increase xtd::threading::countdown_event::current_count. |
| xtd::object_closed_exception | The current instance has already been closed. |
| xtd::invalid_operation_exception | The current instance is already set. |
| xtd::argument_out_of_range_exception | count is less than 0. |
| auto xtd::threading::countdown_event::close | ( | ) | -> void |
Close the current instance of the xtd::threading::countdown_event class.
| auto xtd::threading::countdown_event::reset | ( | ) | -> void |
Resets the xtd::threading::countdown_event to the value of xtd::threading::countdown_event::initial_count.
| xtd::object_closed_exception | The current instance has already been closed. |
| void xtd::threading::countdown_event::reset | ( | xtd::size | count | ) |
Resets the xtd::threading::countdown_event::initial_count property to a specified value.
| count | he number of signals required to set the xtd::threading::countdown_event. |
| xtd::object_closed_exception | The current instance has already been closed. |
| xtd::argument_out_of_range_exception | count is less than 0. |
| auto xtd::threading::countdown_event::signal | ( | ) | -> bool |
Registers a signal with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count.
true if the signal caused the count to reach zero and the event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::nvalid_operation_exception | The current instance is already set. |
| auto xtd::threading::countdown_event::signal | ( | xtd::size | signal_count | ) | -> bool |
Registers multiple signals with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count by the specified amount.
| signal_count | The number of signals to register. |
true if the signal caused the count to reach zero and the event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::argument_out_of_range_exception | signal_count is less than 0. |
| xtd::nvalid_operation_exception | The current instance is already set. |
|
noexcept |
Attempts to increment xtd::threading::countdown_event::current_count by one.
true if the increment succeeded; otherwise, false. If CurrentCount is already at zero, this method will return false.
|
noexcept |
Attempts to increment xtd::threading::countdown_event::current_count by by a specified value.
| count | The value by which to increase xtd::threading::countdown_event::current_count. |
true if the increment succeeded; otherwise, false. If CurrentCount is already at zero, this method will return false. | auto xtd::threading::countdown_event::wait | ( | ) | -> void |
Blocks the current thread until the xtd::threading::countdown_event is set.
| xtd::object_closed_exception | The current instance has already been closed. |
| auto xtd::threading::countdown_event::wait | ( | xtd::int32 | milliseconds_timeout | ) | -> bool |
Blocks the current thread until the xtd::threading::countdown_event is set, using a 32-bit signed integer to measure the timeout.
| milliseconds_timeout | The number of milliseconds to wait, or xtd::threading::timeout::ifinite (-1) to wait indefinitely. |
true if the xtd::threading::countdown_event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::argument_out_of_range_exception | milliseconds_timeout is a negative number other than -1, which represents an infinite time-out.. |
| auto xtd::threading::countdown_event::wait | ( | const cancellation_token & | cancellation_token | ) | -> void |
Blocks the current thread until the xtd::threading::countdown_event is set, while observing a xtd::threading::cancellation_token.
| cancellation_toker | The xtd::threading::cancellation_token to observe. |
| xtd::object_closed_exception | The current instance has already been closed. |
| xtd::operation_canceled_exception | cancellation_token has been canceled. |
| auto xtd::threading::countdown_event::wait | ( | const xtd::time_span & | timeout | ) | -> bool |
Blocks the current thread until the xtd::threading::countdown_event is set, using a xtd::time_span to measure the timeout.
| timeout | A xtd::time_span that represents the number of milliseconds to wait, or a xtd::time_span that represents -1 milliseconds to wait indefinitely. |
true if the xtd::threading::countdown_event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::argument_out_of_range_exception | milliseconds_timeout is a negative number other than -1, which represents an infinite time-out.. |
| auto xtd::threading::countdown_event::wait | ( | xtd::int32 | milliseconds_timeout, |
| const cancellation_token & | cancellation_token ) -> bool |
Blocks the current thread until the xtd::threading::countdown_event is set, using a 32-bit signed integer to measure the timeout, while observing a xtd::threading::cancellation_token.
| milliseconds_timeout | The number of milliseconds to wait, or xtd::threading::timeout::ifinite (-1) to wait indefinitely. |
| cancellation_toker | The xtd::threading::cancellation_token to observe. |
true if the xtd::threading::countdown_event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::operation_canceled_exception | cancellation_token has been canceled. |
| xtd::argument_out_of_range_exception | milliseconds_timeout is a negative number other than -1, which represents an infinite time-out.. |
| auto xtd::threading::countdown_event::wait | ( | const xtd::time_span & | timeout, |
| const cancellation_token & | cancellation_token ) -> bool |
Blocks the current thread until the xtd::threading::countdown_event is set, using a xtd::time_span to measure the timeout, while observing a xtd::threading::cancellation_token.
| timeout | A xtd::time_span that represents the number of milliseconds to wait, or a xtd::time_span that represents -1 milliseconds to wait indefinitely. |
| cancellation_toker | The xtd::threading::cancellation_token to observe. |
true if the xtd::threading::countdown_event was set; otherwise, false. | xtd::object_closed_exception | The current instance has already been closed. |
| xtd::operation_canceled_exception | cancellation_token has been canceled. |
| xtd::argument_out_of_range_exception | milliseconds_timeout is a negative number other than -1, which represents an infinite time-out.. |