xtd 0.2.0
Loading...
Searching...
No Matches

◆ jthread() [2/4]

xtd::threading::jthread::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 object to be passed to the thread when the thread is started and specifying the maximum stack size for the thread.

Parameters
startA delegate that represents the methods to be invoked when this thread begins executing.
max_stack_sizeThe maximum stack size, in bytes, to be used by the thread, or 0 to use the default maximum stack size specified in the header for the executable.
Important For partially trusted code, max_stack_size is ignored if it is greater than the default stack size. No exception is thrown.
Exceptions
xtd::argument_exceptionThe start parameter is empty.
Remarks
A thread does not begin executing when it is created. To schedule the thread for execution, call the xtd::threading::jthread::start method. To pass a data object to the thread, use the xtd::threading::jthread::start(std::any) method overload.