#include <xtd/threading/barrier>
#include <xtd/threading/interlocked>
#include <xtd/threading/thread_pool>
#include <xtd/console>
#include <xtd/startup>
namespace barrier_example {
class program {
public:
static void main() {
auto count = 0;
}}};
try {
}
};
for (auto index = 0; index < 4; ++index)
}
};
}
startup_(barrier_example::program::main);
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
virtual const xtd::string & message() const noexcept
Gets message associate to the exception.
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.hpp:18
The exception that is thrown when the post-phase action of a xtd::threading::barrier fails.
Definition barrier_post_phase_exception.hpp:27
Enables multiple tasks to cooperatively work on an algorithm in parallel through multiple phases.
Definition barrier.hpp:31
int32 remove_participant()
Notifies the Barrier that there will be one less participant.
int32 add_participants(int32 participant_count)
Notifies the xtd::threading::barrier that there will be additional participants.
void close()
Close the current instance of the xtd::threading::barrier class.
void signal_and_wait()
Signals that a participant has reached the barrier and waits for all other participants to reach the ...
static int32 increment(int32 &location) noexcept
Increments a specified variable and stores the result, as an atomic operation.
static bool queue_user_work_item(const wait_callback &callback)
Queues a method for execution. The method executes when a thread pool thread becomes available.
static void join_all()
Blocks the calling thread until all joinable threads terminate.
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:168
delegate< void(arguments_t...)> action
Represents a xtd::delegate that has variable parameters and does not return a value.
Definition action.hpp:20
@ b
The B key.
Definition console_key.hpp:90
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition abandoned_mutex_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8