Thread¶
| Spice | |
|---|---|
Thread struct¶
Lightweight thread, that uses posix threads (pthread) under the hood.
Constructors¶
ctor¶
| Spice | |
|---|---|
Construct a thread from a procedure to run
Parameters
| Name | Type | Description |
|---|---|---|
threadRoutine |
p() |
Procedure to execute on the thread |
ctor¶
| Spice | |
|---|---|
Construct a thread from a lambda to run
Parameters
| Name | Type | Description |
|---|---|---|
threadRoutine |
const Lambda<p()>& |
Lambda to execute on the thread |
Methods¶
run¶
| Spice | |
|---|---|
Start the thread
join¶
| Spice | |
|---|---|
Wait synchronous until the thread has terminated
getId¶
| Spice | |
|---|---|
Retrieve the ID of the current thread
Returns: Pthread_t
Functions¶
getThreadId¶
| Spice | |
|---|---|
Retrieve the ID of the current thread
Returns: Pthread_t