Represents a synchronization primitive that is signaled when its count reaches zero.
Public Constructors | |
countdown_event (int32 initial_count) | |
Initializes a new instance of xtd::threading::countdown_event class with the specified count. | |
Public Properties | |
int32 | current_count () const |
Gets the number of remaining signals required to set the event. | |
int32 | initial_count () const |
Gets the numbers of signals initially required to set the event. | |
bool | is_set () const |
ndicates whether the xtd::threading::countdown_event object's current count has reached zero. | |
const xtd::threading::wait_handle & | wait_handle () const |
Gets a xtd::threading::wait_handle that is used to wait for the event to be set. | |
xtd::threading::wait_handle & | wait_handle () |
Gets a xtd::threading::wait_handle that is used to wait for the event to be set. | |
Public Methods | |
void | add_count () |
Increments the xtd::threading::countdown_event's current count by one. | |
void | add_count (int32 count) |
Increments the xtd::threading::countdown_event's current count by one. | |
void | close () |
Close the current instance of the xtd::threading::countdown_event class. | |
void | reset () |
Resets the xtd::threading::countdown_event to the value of xtd::threading::countdown_event::initial_count. | |
void | reset (int32 count) |
Resets the xtd::threading::countdown_event::initial_count property to a specified value. | |
bool | signal () |
Registers a signal with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count. | |
bool | signal (int32 signal_count) |
Registers multiple signals with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count by the specified amount. | |
bool | try_add_count () noexcept |
Attempts to increment xtd::threading::countdown_event::current_count by one. | |
bool | try_add_count (int32 count) noexcept |
Attempts to increment xtd::threading::countdown_event::current_count by by a specified value. | |
void | wait () |
Blocks the current thread until the xtd::threading::countdown_event is set. | |
bool | wait (int32 milliseconds_timeout) |
Blocks the current thread until the xtd::threading::countdown_event is set, using a 32-bit signed integer to measure the timeout. | |
void | wait (const cancellation_token &cancellation_token) |
Blocks the current thread until the xtd::threading::countdown_event is set, while observing a xtd::threading::cancellation_token. | |
bool | wait (const time_span &timeout) |
Blocks the current thread until the xtd::threading::countdown_event is set, using a xtd::time_span to measure the timeout. | |
bool | wait (int32 milliseconds_timeout, const cancellation_token &cancellation_token) |
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. | |
bool | wait (const time_span &timeout, const cancellation_token &cancellation_token) |
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 | |
Public Member Functions inherited from xtd::object | |
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 size_t | 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<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
virtual xtd::string | to_string () const noexcept |
Returns a xtd::string that represents the current object. | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename 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<typename object_a_t , typename 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. |
int32 xtd::threading::countdown_event::current_count | ( | ) | const |
Gets the number of remaining signals required to set the event.
xtd::object_closed_exception | The current instance has already been closed. |
int32 xtd::threading::countdown_event::initial_count | ( | ) | const |
Gets the numbers of signals initially required to set the event.
xtd::object_closed_exception | The current instance has already been closed. |
bool xtd::threading::countdown_event::is_set | ( | ) | const |
ndicates whether the xtd::threading::countdown_event object's current count has reached zero.
xtd::object_closed_exception | The current instance has already been closed. |
const xtd::threading::wait_handle & xtd::threading::countdown_event::wait_handle | ( | ) | const |
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. |
xtd::threading::wait_handle & xtd::threading::countdown_event::wait_handle | ( | ) |
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. |
void xtd::threading::countdown_event::add_count | ( | ) |
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. |
void xtd::threading::countdown_event::add_count | ( | int32 | count | ) |
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. |
void xtd::threading::countdown_event::close | ( | ) |
Close the current instance of the xtd::threading::countdown_event class.
void xtd::threading::countdown_event::reset | ( | ) |
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 | ( | int32 | 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. |
bool xtd::threading::countdown_event::signal | ( | ) |
Registers a signal with the xtd::threading::countdown_event, decrementing the value of xtd::threading::countdown_event::current_count.
xtd::object_closed_exception | The current instance has already been closed. |
xtd::nvalid_operation_exception | The current instance is already set. |
bool xtd::threading::countdown_event::signal | ( | int32 | signal_count | ) |
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. |
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.
|
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. |
void xtd::threading::countdown_event::wait | ( | ) |
Blocks the current thread until the xtd::threading::countdown_event is set.
xtd::object_closed_exception | The current instance has already been closed. |
bool xtd::threading::countdown_event::wait | ( | int32 | milliseconds_timeout | ) |
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. |
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.. |
void xtd::threading::countdown_event::wait | ( | const cancellation_token & | cancellation_token | ) |
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. |
bool xtd::threading::countdown_event::wait | ( | const time_span & | timeout | ) |
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. |
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.. |
bool xtd::threading::countdown_event::wait | ( | int32 | milliseconds_timeout, |
const cancellation_token & | cancellation_token | ||
) |
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. |
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.. |
bool xtd::threading::countdown_event::wait | ( | const time_span & | timeout, |
const cancellation_token & | cancellation_token | ||
) |
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. |
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.. |