|
Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
|
A simple thread class.
The thread class makes it possible to design a platform independent system using threads.
#include <ThreadLib.h>

Public Member Functions | |
| Thread () | |
| Uninitialized storage; call Thread_constructor before use/destruction. More... | |
| Thread (Thread_Run r, ThreadPriority priority, int stackSize) | |
| Create a thread. More... | |
| ~Thread () | |
| Release platform thread resources (C: Thread_destructor). More... | |
| void | start () |
| Release the constructed thread to run its entry point once (C: Thread_start). More... | |
Static Public Member Functions | |
| static void | sleep (unsigned int milliseconds) |
| Delay the calling thread (C: Thread_sleep). More... | |
| Thread::Thread | ( | ) |
Uninitialized storage; call Thread_constructor before use/destruction.
| Thread::Thread | ( | Thread_Run | r, |
| ThreadPriority | priority, | ||
| int | stackSize | ||
| ) |
Create a thread.
| r | Required entry-point callback invoked after start. Keep the Thread object and callback dependencies alive until execution finishes. |
| priority | One of the five ThreadPriority values, mapped by the port. |
| stackSize | Requested stack allocation in bytes, a positive value large enough for the callback and its libraries. Ports can round up or add overhead; this is not a portable exact stack-size guarantee. Construction creates thread resources but start releases the entry point to run. No failure status is returned; major ports call baFatalE for creation failures. C equivalent: Thread_constructor. |
| Thread::~Thread | ( | ) |
Release platform thread resources (C: Thread_destructor).
This is not a portable join or cancellation API. Arrange completion before destroying storage used by a running thread.
|
static |
Delay the calling thread (C: Thread_sleep).
| [in] | milliseconds | Requested delay in milliseconds. Resolution, rounding and zero-delay behavior are platform-specific. Does not release an application mutex; scheduler delays can extend the wait. |
| void Thread::start | ( | ) |
Release the constructed thread to run its entry point once (C: Thread_start).
Call only once; does not wait for completion.