xtd 0.2.0
Loading...
Searching...
No Matches
jthread.h
Go to the documentation of this file.
1
4#pragma once
5#include "thread.h"
6
8namespace xtd {
10 namespace threading {
32 public:
34
52 explicit jthread(const xtd::threading::thread_start& start);
58 jthread(const xtd::threading::thread_start& start, int32 max_stack_size);
60
62
74
76 jthread();
77 template <typename start_t>
78 jthread(start_t start) : jthread(parameterized_thread_start {start}) {}
79 template <typename start_t>
80 jthread(start_t start, int32 max_stack_size) : jthread(parameterized_thread_start {start}, max_stack_size) {}
81 jthread(jthread&&) = default;
82 jthread(const jthread&) = default;
83 jthread& operator=(const jthread&) = default;
84 template <typename start_t>
85
86 static jthread start_new(start_t start) {return start_new(thread_start {start});}
87 template <typename start_t>
88 static jthread start_new(start_t start, std::any obj) {return start_new(parameterized_thread_start {start}, obj);}
90
91 private:
92 using thread::auto_join;
93 };
94 }
95}
Creates and controls an automatically rejoins on destruction thread, sets its priority,...
Definition jthread.h:31
static jthread start_new(const xtd::threading::thread_start &start)
Create and immedialtely start a xtd::threading::jthread with specified method.
jthread(const xtd::threading::parameterized_thread_start &start)
Initializes a new instance of the xtd::threading::jthread class, specifying a delegate that allows an...
static jthread start_new(const xtd::threading::parameterized_thread_start &start, std::any obj)
Create and immedialtely start a xtd::threading::jthread with specified method.
jthread(const xtd::threading::thread_start &start, int32 max_stack_size)
Initializes a new instance of the xtd::threading::jthread class, specifying the maximum stack size fo...
jthread(const xtd::threading::thread_start &start)
Initializes a new instance of the xtd::threading::jthread class.
jthread(const xtd::threading::parameterized_thread_start &start, int32 max_stack_size)
Initializes a new instance of the xtd::threading::jthread class, specifying a delegate that allows an...
Creates and controls a thread, sets its priority, and gets its status.
Definition thread.h:43
#define core_export_
Define shared library export.
Definition core_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
delegate< void(std::any)> parameterized_thread_start
Represents the method that executes on a xtd::threading::thread.
Definition parameterized_thread_start.h:26
delegate< void()> thread_start
Represents the method that executes on a xtd::threading::thread.
Definition thread_start.h:24
@ start
Starting of a logical operation.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::threading::thread class.