Shows how to use xtd::threading::thread class.
#include <xtd/threading/thread>
#include <xtd/console>
#include <xtd/startup>
class thread_example {
public:
static void thread_proc() {
for (
auto i = 0;
i < 10; ++
i) {
}
}
static void main() {
for (
auto i = 0;
i < 4; ++
i) {
}
console::write_line(
"Main thread: thread_proc.join has returned. Press Enter to end program.");
}
};
static xtd::string read_line()
Reads the next line of characters from the standard input stream.
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Creates and controls a thread, sets its priority, and gets its status.
Definition thread.hpp:45
static void sleep(int32 milliseconds_timeout)
Suspends the current thread for a specified time.
#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:167
@ i
The I key.
Definition console_key.hpp:104
@ t
The T key.
Definition console_key.hpp:126
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