Module |
|
Header |
/Engine/Source/Runtime/Core/Public/HAL/Thread.h |
Include |
#include "HAL/Thread.h" |
class FThread
Simple API for system threads. Before using, please make sure you really need a new system thread. By default and in the majority of cases parallel processing should be done by TaskGraph. For richer functionality check [FRunnable](API\Runtime\Core\HAL\FRunnable)_/
FRunnableThread. It's up to user to provide a way to notify the thread function to exit on demand. Before destroying the instance it must be either Join_ed or
Detach_ed. Example: FThread Thread{TEXT("New thread"), []() { do_something_important(); }}; ... continue in the caller thread Thread.Join(); For more verbose example check `TestTypicalUseCase in `ThreadTest.cpp_
Name | Description | |
---|---|---|
|
FThread() |
Creates new "empty" thread object that doesn't represent a system thread |
|
FThread ( |
Non-copyable |
|
FThread ( |
|
|
FThread ( |
Creates and immediately starts a new system thread that will execute `ThreadFunction_ argument. |
Name | Description | |
---|---|---|
|
~FThread() |
Destructor asserts if the instance is not joined or detached. |
Name | Description | ||
---|---|---|---|
|
GetThreadId() |
||
|
IsJoinable() |
Checks if the thread object identifies an active thread of execution. |
|
|
Join() |
Blocks the current thread until the thread identified by `this_ finishes its execution. |
Name |
Description |
---|---|
InvalidThreadId |