Threads

threads.h Contains thread-related os apis More...

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)

Detailed Description


Function Documentation

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.

Parameters:
[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.
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_CREATE_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_ExitThread NATIVE_TID  td  ) 
 

Causes a running thread to exit.

Parameters:
[in] td Thread descriptor
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_EXIT_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_GetTid NATIVE_TID id  ) 
 

Retrieves the current thread's handle.

Parameters:
[out] id Address of handle container variable
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_QUERY_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_RaiseException NATIVE_TID  td,
UINT32  code
 

Raise an exception.

Parameters:
[in] td Thread descriptor
[in] code Exception type
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_SLEEP_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_ResumeThread NATIVE_TID  td  ) 
 

Resumes running thread.

Parameters:
[in] td Thread descriptor
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_RESUME_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_Sleep INT  interval  ) 
 

Sends thread to sleep.

Parameters:
[in] interval Interval to sleep in milli-seconds.
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_SLEEP_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

OS_RETURN_CODE OS_SuspendThread NATIVE_TID  td  ) 
 

Suspends a running thread.

Parameters:
[in] td Thread descriptor
Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_SUSPEND_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All

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.

Parameters:
[in] code The thread exit code as passed from the caller
[out] dwordToReset This memory location is cleared (set to zero).
Return values:
OS_RETURN_CODE_THREAD_EXIT_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Linux & OS X*
CPU: All

OS_RETURN_CODE OS_Yield void   ) 
 

Pre-empts the thread specified by the running thread.

Return values:
OS_RETURN_CODE_NO_ERROR If the operation succeeded
OS_RETURN_CODE_THREAD_SLEEP_FAILED If the operation Failed
Returns:
Operation status code.
Availability:
O/S: Windows, Linux & OS X*
CPU: All


Generated on Thu Feb 2 21:59:16 2017 for PinCRT by  doxygen 1.4.6