Thread factory, which can be used in order to configure the properties of a new thread.
More...
|
| auto | name (String name) -> Builder & |
| | Sets the name of the thread-to-be.
|
| |
| auto | stack_size (usize size) -> Builder & |
| | Sets the size of the stack for the new thread.
|
| |
|
auto | no_hooks () -> Builder & |
| | Disables running and inheriting thread spawn hooks.
|
| |
| template<typename F > |
| auto | spawn (F &&f) -> io::Result< JoinHandle< mtp::invoke_result_t< F > > > |
| | Spawns a new thread by taking ownership of the Builder and calling f.
|
| |
|
|
static auto | make () -> Builder |
| | Creates a new Builder with default configuration.
|
| |
Thread factory, which can be used in order to configure the properties of a new thread.
◆ name()
| auto rstd::thread::builder::Builder::name |
( |
String | name | ) |
-> Builder& |
|
inline |
Sets the name of the thread-to-be.
- Parameters
-
| name | The thread name for identification in panic messages. |
◆ spawn()
template<typename F >
| auto rstd::thread::builder::Builder::spawn |
( |
F && | f | ) |
-> io::Result<JoinHandle<mtp::invoke_result_t<F>>>
|
|
inline |
Spawns a new thread by taking ownership of the Builder and calling f.
- Template Parameters
-
| F | The callable type for the thread entry point. |
- Parameters
-
| f | The closure or function to execute in the new thread. |
- Returns
- A JoinHandle on success, or an I/O error on failure.
◆ stack_size()
| auto rstd::thread::builder::Builder::stack_size |
( |
usize | size | ) |
-> Builder& |
|
inline |
Sets the size of the stack for the new thread.
- Parameters
-
| size | The stack size in bytes. |
The documentation for this struct was generated from the following file:
- /home/runner/work/rstd/rstd/src/std/thread/builder.cppm