Foxit PDF SDK
|
Header file for Process & thread related definitions and classes. More...
Go to the source code of this file.
Classes | |
struct | FX_HTHREAD |
Type definition of mutex handle. More... | |
class | CFX_RWLock |
Under non-threading mode, defines as empty implementation. More... | |
class | CFX_SpinLock |
Under non-threading mode, defines as empty implementation. More... | |
struct | FX_SYSTEMTIME |
Structure of system time. More... | |
struct | FX_THREADHANDLER |
Thread handler for application extension. More... | |
struct | FXCRT_DATETIMEZONE |
Structure for date and time. More... | |
Typedefs | |
typedef FX_ThreadResult(WINAPI * | FX_CALLBACK_ThreadProxyProc) (FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param) |
Callback function of thread proxy procedure. More... | |
Type for process ID | |
typedef FX_DWORD | FX_PROCESSID |
Process ID. | |
Functions | |
Time | |
void | FX_Time_GetSystemTime (FX_SYSTEMTIME *pSystemTime) |
Retrieve the current system date and time. More... | |
void | FX_Time_GetLocalTime (FX_SYSTEMTIME *pSystemTime) |
Retrieve the current local date and time. More... | |
FX_DWORD | FX_Time_GetClock () |
Get the clock ticks elapsed by calling process. More... | |
FX_DWORD | FX_Time_Sleep (FX_DWORD dwMilliseconds) |
Delay the current running for specified milliseconds. More... | |
void | FXCRT_GetCurrentSystemTime (FXCRT_DATETIMEZONE &dt) |
Get current system date,time and timezone information. More... | |
Process management | |
void | FX_Process_Initialize () |
Initialize process. More... | |
void | FX_Process_Finalize () |
Finalize process. More... | |
FX_PROCESSID | FX_Process_GetID () |
Get the current process ID. More... | |
FX_LPVOID | FX_Process_GetPrivateData (FX_LPVOID key) |
Get private data in the current process. More... | |
void | FX_Process_SetPrivateData (FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback) |
Set private data in the current process. More... | |
void | FX_Process_RemovePrivateData (FX_LPVOID key) |
Remove private data in the current process. More... | |
CFX_ProcessContext * | FX_Process_GetContext () |
Retrieve process context. More... | |
Thread handler | |
FX_THREADHANDLER * | FX_Thread_GetHandler () |
Get the current thread handler. More... | |
void | FX_Thread_SetHandler (FX_THREADHANDLER *pThreadHandler) |
Set the current thread handler. More... | |
Thread functions | |
FX_HTHREAD | FX_Thread_Create (FX_INT32 nPriority, size_t szStack, FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param) |
Create a new thread. More... | |
void | FX_Thread_Exit () |
Exit from the current thread. More... | |
FX_HTHREAD | FX_Thread_GetHandle () |
Get the current thread handle. More... | |
void | FX_Thread_Yield () |
Yield the processor to another thread. More... | |
FX_INT32 | FX_Thread_GetLastError () |
Get the last error code in the current thread. More... | |
void | FX_Thread_SetLastError (FX_INT32 nErr) |
Set the last error code in the current thread. More... | |
FX_LPVOID | FX_Thread_GetPrivateData (FX_LPVOID key) |
Get private data in the current thread. More... | |
void | FX_Thread_SetPrivateData (FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback) |
Set private data in the current thread. More... | |
void | FX_Thread_RemovePrivateData (FX_LPVOID key) |
Remove private data in the current thread. More... | |
FX_INT32 | FX_Thread_GetPriority (FX_HTHREAD hThread) |
Get thread priority. More... | |
void | FX_Thread_SetPriority (FX_HTHREAD hThread, FX_INT32 nPriority) |
Set thread priority. More... | |
FX_INT32 | FX_Thread_WaitForSingleThread (FX_HTHREAD hThread) |
Wait for termination of a single thread. More... | |
FX_INT32 | FX_Thread_WaitForMultipleThreads (const FX_HTHREAD *pThreads, FX_INT32 nCount) |
Wait for termination of multiple threads. More... | |
Context access | |
CFX_ThreadContext * | FX_Thread_GetContext () |
Get the current thread context. More... | |
CFX_ExceptionContext * | FX_Thread_GetExceptionContext () |
Get the current thread exception context. More... | |
Mutex | |
| |
FX_BOOL | FX_Mutex_Initialize (FX_MUTEX *pMutex) |
Initialize a mutex. More... | |
void | FX_Mutex_Destroy (FX_MUTEX *pMutex) |
Destroy a mutex. More... | |
FX_BOOL | FX_Mutex_TryLock (FX_MUTEX *pMutex) |
Try to lock a mutex. More... | |
void | FX_Mutex_Lock (FX_MUTEX *pMutex) |
Lock a mutex. More... | |
void | FX_Mutex_Unlock (FX_MUTEX *pMutex) |
Unlock a mutex. More... | |
Atomic Count | |
| |
FX_INT32 | FX_Atom_Add32 (volatile FX_INT32 *pAddend, FX_INT32 nIncrement) |
Increase 32-bits integer value. More... | |
FX_INT32 | FX_Atom_Subtract32 (volatile FX_INT32 *pAddend, FX_INT32 nDecrement) |
Decrease 32-bits integer value. More... | |
FX_INT64 | FX_Atom_Add64 (volatile FX_INT64 *pAddend, FX_INT64 nIncrement) |
Increase 64-bits integer value. More... | |
FX_INT64 | FX_Atom_Subtract64 (volatile FX_INT64 *pAddend, FX_INT64 nDecrement) |
Decrease 64-bits integer value. More... | |
Flags for thread priorities | |
#define | FX_THREADPRIORITY_Lowest -2 |
Lowest priority. | |
#define | FX_THREADPRIORITY_Lower -1 |
Lower priority. | |
#define | FX_THREADPRIORITY_Normal 0 |
Normal priority. | |
#define | FX_THREADPRIORITY_Higher 1 |
Higher priority. | |
#define | FX_THREADPRIORITY_Highest 2 |
Highest priority. | |
#define | THREAD_CALL_CONVENTION WINAPI |
typedef DWORD | FX_ThreadResult |
typedef FX_ThreadResult(WINAPI * | FX_CALLBACK_ThreadProc) (FX_LPVOID param) |
Callback function of thread procedure. More... | |
Spin Lock | |
| |
#define | FXMT_SPLOCK_THIS |
#define | FXMT_SPLOCK_OBJ(lock) |
FX_BOOL | FX_SpinLock_Initialize (FX_SPINLOCK *pSpinLock) |
Initialize a spin lock. More... | |
void | FX_SpinLock_Destroy (FX_SPINLOCK *pSpinLock) |
Destroy a spin lock. More... | |
FX_BOOL | FX_SpinLock_TryLock (FX_SPINLOCK *pSpinLock) |
Try to lock a spin lock. More... | |
void | FX_SpinLock_Lock (FX_SPINLOCK *pSpinLock) |
Lock a spin lock. More... | |
void | FX_SpinLock_Unlock (FX_SPINLOCK *pSpinLock) |
Unlock a spin lock. More... | |
FX_BOOL | FX_SpinLock_IsLocked (FX_SPINLOCK *pSpinLock) |
Determine whether specified spin lock is locked or not. More... | |
Read-Write lock | |
| |
#define | FXMT_RWLOCK_THIS |
#define | FXMT_RWLOCK_OBJ(lock, s) |
#define | FXMT_RWLOCK_DEFINEOBJ(rwLock, lock, s) |
#define | FXMT_RWLOCKOBJECT_DEFINE(rwLockObj) |
#define | FXMT_RWLOCKOBJECT_TRYREADLOCK(lockObj) |
#define | FXMT_RWLOCKOBJECT_TRYREADLOCK_IF(lockObj) |
#define | FXMT_RWLOCKOBJECT_READLOCK(lockObj) |
#define | FXMT_RWLOCKOBJECT_READUNLOCK(lockObj) |
#define | FXMT_RWLOCKOBJECT_TRYWRITELOCK(lockObj) |
#define | FXMT_RWLOCKOBJECT_TRYWRITELOCK_IF(lockObj) |
#define | FXMT_RWLOCKOBJECT_WRITELOCK(lockObj) |
#define | FXMT_RWLOCKOBJECT_WRITEUNLOCK(lockObj) |
FX_BOOL | FX_RWLock_Initialize (FX_RWLOCK *pRWLock) |
Initialize a read-write lock. More... | |
void | FX_RWLock_Destroy (FX_RWLOCK *pRWLock) |
Destroy a read-write lock. More... | |
FX_BOOL | FX_RWLock_TryReadLock (FX_RWLOCK *pRWLock) |
Try to lock for share read. More... | |
void | FX_RWLock_ReadLock (FX_RWLOCK *pRWLock) |
Lock for share read. More... | |
void | FX_RWLock_ReadUnlock (FX_RWLOCK *pRWLock) |
Unlock for share read. More... | |
FX_BOOL | FX_RWLock_TryWriteLock (FX_RWLOCK *pRWLock) |
Try to lock for exclusive write. More... | |
void | FX_RWLock_WriteLock (FX_RWLOCK *pRWLock) |
Lock for exclusive write. More... | |
void | FX_RWLock_WriteUnlock (FX_RWLOCK *pRWLock) |
Unlock for exclusive write. More... | |
Header file for Process & thread related definitions and classes.
Copyright (C) 2003-2020, Foxit Software Inc.. All Rights Reserved.
The following code is copyrighted and is the proprietary of Foxit Software Inc.. It is not allowed to distribute any parts of Foxit PDF SDK to third party or public without permission unless an agreement is signed between Foxit Software Inc. and customers to explicitly grant customers permissions.
Increase 32-bits integer value.
[in,out] | pAddend | Pointer to 32-bits integer to increase value. |
[in] | nIncrement | Increment value to be added to pAddend. |
Increase 64-bits integer value.
[in,out] | pAddend | Pointer to 64-bits integer to increase value. |
[in] | nIncrement | Increment value to be added to pAddend. |
Decrease 32-bits integer value.
[in,out] | pAddend | Pointer to 32-bits integer to decrease value. |
[in] | nDecrement | Decrement value to be subtracted from pAddend. |
Decrease 64-bits integer value.
[in,out] | pAddend | Pointer to 64-bits integer to decrease value. |
[in] | nDecrement | Decrement value to be subtracted from pAddend. |
void FX_Mutex_Destroy | ( | FX_MUTEX * | pMutex | ) |
Destroy a mutex.
[in] | pMutex | Pointer to a mutex to be destroyed. Must be not a NULL pointer. |
Initialize a mutex.
[in] | pMutex | Pointer to a mutex which need to be initialized. Must be not a NULL pointer. |
void FX_Mutex_Lock | ( | FX_MUTEX * | pMutex | ) |
Lock a mutex.
[in] | pMutex | Pointer to a mutex. Must be not a NULL pointer. |
Try to lock a mutex.
[in] | pMutex | Pointer to a mutex. Must be not a NULL pointer. |
void FX_Mutex_Unlock | ( | FX_MUTEX * | pMutex | ) |
Unlock a mutex.
[in] | pMutex | Pointer to a mutex. Must be not a NULL pointer. |
void FX_RWLock_Destroy | ( | FX_RWLOCK * | pRWLock | ) |
Destroy a read-write lock.
[in] | pRWLock | Pointer to a read-write lock to be destroyed. Must be not a NULL pointer. |
FX_BOOL FX_RWLock_Initialize | ( | FX_RWLOCK * | pRWLock | ) |
Initialize a read-write lock.
[in] | pRWLock | Pointer to a read-write lock which need to be initialized. Must be not a NULL pointer. |
void FX_RWLock_ReadLock | ( | FX_RWLOCK * | pRWLock | ) |
Lock for share read.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
void FX_RWLock_ReadUnlock | ( | FX_RWLOCK * | pRWLock | ) |
Unlock for share read.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
FX_BOOL FX_RWLock_TryReadLock | ( | FX_RWLOCK * | pRWLock | ) |
Try to lock for share read.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
FX_BOOL FX_RWLock_TryWriteLock | ( | FX_RWLOCK * | pRWLock | ) |
Try to lock for exclusive write.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
void FX_RWLock_WriteLock | ( | FX_RWLOCK * | pRWLock | ) |
Lock for exclusive write.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
void FX_RWLock_WriteUnlock | ( | FX_RWLOCK * | pRWLock | ) |
Unlock for exclusive write.
[in] | pRWLock | Pointer to a read-write lock. Must be not a NULL pointer. |
void FX_SpinLock_Destroy | ( | FX_SPINLOCK * | pSpinLock | ) |
Destroy a spin lock.
[in] | pSpinLock | Pointer to a spin lock to be destroyed. |
FX_BOOL FX_SpinLock_Initialize | ( | FX_SPINLOCK * | pSpinLock | ) |
Initialize a spin lock.
[in] | pSpinLock | Pointer to a spin lock to be initialized. |
FX_BOOL FX_SpinLock_IsLocked | ( | FX_SPINLOCK * | pSpinLock | ) |
Determine whether specified spin lock is locked or not.
[in] | pSpinLock | Pointer to a spin lock. |
void FX_SpinLock_Lock | ( | FX_SPINLOCK * | pSpinLock | ) |
Lock a spin lock.
[in] | pSpinLock | Pointer to a spin lock. |
FX_BOOL FX_SpinLock_TryLock | ( | FX_SPINLOCK * | pSpinLock | ) |
Try to lock a spin lock.
[in] | pSpinLock | Pointer to a spin lock. |
void FX_SpinLock_Unlock | ( | FX_SPINLOCK * | pSpinLock | ) |
Unlock a spin lock.
[in] | pSpinLock | Pointer to a spin lock. |
FX_HTHREAD FX_Thread_Create | ( | FX_INT32 | nPriority, |
size_t | szStack, | ||
FX_CALLBACK_ThreadProc | threadProc, | ||
FX_LPVOID | param | ||
) |
Create a new thread.
[in] | nPriority | Thread priority. |
[in] | szStack | Stack size of thread, set to 0 for default stack size. |
[in] | threadProc | Thread callback function. |
[in] | param | Parameter passed to thread procedure. |
void FX_Thread_Exit | ( | ) |
Exit from the current thread.
CFX_ThreadContext* FX_Thread_GetContext | ( | ) |
Get the current thread context.
CFX_ExceptionContext* FX_Thread_GetExceptionContext | ( | ) |
Get the current thread exception context.
FX_HTHREAD FX_Thread_GetHandle | ( | ) |
Get the current thread handle.
FX_THREADHANDLER* FX_Thread_GetHandler | ( | ) |
Get the current thread handler.
FX_INT32 FX_Thread_GetLastError | ( | ) |
Get the last error code in the current thread.
FX_INT32 FX_Thread_GetPriority | ( | FX_HTHREAD | hThread | ) |
Get thread priority.
[in] | hThread | Thread handle specifies a thread to retrieve its priority. |
Get private data in the current thread.
[in] | key | Key value to specify private data to be retrieved. |
void FX_Thread_RemovePrivateData | ( | FX_LPVOID | key | ) |
Remove private data in the current thread.
[in] | key | Key value to specify private data to be removed. |
void FX_Thread_SetHandler | ( | FX_THREADHANDLER * | pThreadHandler | ) |
Set the current thread handler.
[in] | pThreadHandler | Pointer to external thread handler. |
void FX_Thread_SetLastError | ( | FX_INT32 | nErr | ) |
Set the last error code in the current thread.
[in] | nErr | The last error code to be set. |
void FX_Thread_SetPriority | ( | FX_HTHREAD | hThread, |
FX_INT32 | nPriority | ||
) |
Set thread priority.
[in] | hThread | Thread handle specifies a thread to change its priority. |
[in] | nPriority | Thread priority code. |
void FX_Thread_SetPrivateData | ( | FX_LPVOID | key, |
FX_LPVOID | data, | ||
PD_CALLBACK_FREEDATA | callback | ||
) |
Set private data in the current thread.
[in] | key | Key value to specify private data to be set. |
[in] | data | Pointer to private data. |
[in] | callback | Callback function address which is used to free private data. Pass NULL if need no additional process to free private data. |
Wait for termination of multiple threads.
[in] | pThreads | Pointer to array of thread handles. |
[in] | nCount | Number of threads in array. |
FX_INT32 FX_Thread_WaitForSingleThread | ( | FX_HTHREAD | hThread | ) |
Wait for termination of a single thread.
[in] | hThread | Thread handle specifies a thread to wait. |
void FX_Thread_Yield | ( | ) |
Yield the processor to another thread.