PinCRT
|
Functions | |
OS_RETURN_CODE | OS_CreateThread (VOID(*ThreadMainFunction)(VOID *), VOID *ThreadParam, VOID *stackBottom, ADDRINT stackSize, NATIVE_TID *td) |
OS_RETURN_CODE | OS_ExitThread (NATIVE_TID td) |
OS_RETURN_CODE | OS_ThreadExitAndClear (void *stackAddr, ADDRINT stackSize, INT32 *dwordToReset) |
OS_RETURN_CODE | OS_SuspendThread (NATIVE_TID td) |
OS_RETURN_CODE | OS_ResumeThread (NATIVE_TID td) |
OS_RETURN_CODE | OS_Sleep (INT interval) |
OS_RETURN_CODE | OS_GetTid (NATIVE_TID *id) |
OS_RETURN_CODE | OS_Yield (void) |
OS_RETURN_CODE | OS_RaiseException (NATIVE_TID td, UINT32 code) |
OS_RETURN_CODE OS_CreateThread | ( | VOID(*)(VOID *) | ThreadMainFunction, |
VOID * | ThreadParam, | ||
VOID * | stackBottom, | ||
ADDRINT | stackSize, | ||
NATIVE_TID * | td | ||
) |
Create a new thread in the current process.
[in] | ThreadMainFunction | Thread start address |
[in] | ThreadParam | Thread optional parameter |
[in] | stackBottom | The base address of the thread's stack. This argument can be NULL. In that case this function will allocate the stack according to the stackSize argument. |
[in] | stackSize | The size of the thread's stack. |
[out] | td | The descriptor of newly created thread. |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_CREATE_FAILED | If the operation Failed |
OS_RETURN_CODE OS_ExitThread | ( | NATIVE_TID | td | ) |
Causes a running thread to exit.
[in] | td | Thread descriptor |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_EXIT_FAILED | If the operation Failed |
OS_RETURN_CODE OS_GetTid | ( | NATIVE_TID * | id | ) |
Retrieves the current thread's handle.
[out] | id | Address of handle container variable |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_QUERY_FAILED | If the operation Failed |
OS_RETURN_CODE OS_RaiseException | ( | NATIVE_TID | td, |
UINT32 | code | ||
) |
Raise an exception.
[in] | td | Thread descriptor |
[in] | code | Exception type |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_SLEEP_FAILED | If the operation Failed |
OS_RETURN_CODE OS_ResumeThread | ( | NATIVE_TID | td | ) |
Resumes running thread.
[in] | td | Thread descriptor |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_RESUME_FAILED | If the operation Failed |
OS_RETURN_CODE OS_Sleep | ( | INT | interval | ) |
Sends thread to sleep.
[in] | interval | Interval to sleep in milli-seconds. |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_SLEEP_FAILED | If the operation Failed |
OS_RETURN_CODE OS_SuspendThread | ( | NATIVE_TID | td | ) |
Suspends a running thread.
[in] | td | Thread descriptor |
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_SUSPEND_FAILED | If the operation Failed |
OS_RETURN_CODE OS_ThreadExitAndClear | ( | void * | stackAddr, |
ADDRINT | stackSize, | ||
INT32 * | dwordToReset | ||
) |
This function clears a word and then exits the calling thread. It guaranteess that it will use only register state (no memory) once word is cleared.
[in] | code | The thread exit code as passed from the caller |
[out] | dwordToReset | This memory location is cleared (set to zero). |
OS_RETURN_CODE_THREAD_EXIT_FAILED | If the operation Failed |
OS_RETURN_CODE OS_Yield | ( | void | ) |
Pre-empts the thread specified by the running thread.
OS_RETURN_CODE_NO_ERROR | If the operation succeeded |
OS_RETURN_CODE_THREAD_SLEEP_FAILED | If the operation Failed |