Foxit PDF SDK

fx_process.h
Go to the documentation of this file.
1
20 #ifndef _FX_PROCESS_H_
21 #define _FX_PROCESS_H_
22
23 #ifndef _FX_BASIC_H_
24 #include "fx_basic.h"
25 #endif
26
27 #if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_LINUX_EMBEDDED_ || _FX_OS_ == _FX_ANDROID_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
28 #include <time.h>
29 #include <sys/time.h>
30 #include <pthread.h>
31 #include <unistd.h>
32 #endif
33
34 //external classes
35 class CFX_ProcessContext;
36 class CFX_ThreadContext;
37 class CFX_ExceptionContext;
38
39 //*****************************************************************************
40 //* Time
41 //*****************************************************************************
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
50
52 typedef struct _FX_SYSTEMTIME
53 {
54 FX_WORD wYear; //Year
55 FX_WORD wMonth; //Month, 1 - 12
56 FX_WORD wDayOfWeek; //Day of week, Sunday is 0, Monday is 1, ...
57 FX_WORD wDay; //Day of month, start from 1 - 31
58 FX_WORD wHour; //Hour, 0 - 23
59 FX_WORD wMinute; //Minute, 0 - 59
60 FX_WORD wSecond; //Second, 0 - 59
61 FX_WORD wMilliseconds; //Millisecond, 0 - 999
62 } FX_SYSTEMTIME;
63
71 void FX_Time_GetSystemTime(FX_SYSTEMTIME* pSystemTime);void FX_Time_GetLocalTime(FX_SYSTEMTIME* pSystemTime);
84 FX_DWORD FX_Time_GetClock();
92 FX_DWORD FX_Time_Sleep(FX_DWORD dwMilliseconds);
93
95 typedef struct _FXCRT_DATETIMEZONE
96 {
98 FX_WORD year;
100 FX_WORD month;
102 FX_WORD day;
104 FX_WORD dayOfWeek;
106 FX_WORD hour;
108 FX_WORD minute;
110 FX_WORD second;
112 FX_WORD milliseconds;
118 FX_INT32 tzHour;//TESTDOC: BUG#CORE-2923
120 FX_WORD tzMinute;
121 } FXCRT_DATETIMEZONE;
122
130 void FXCRT_GetCurrentSystemTime(FXCRT_DATETIMEZONE& dt);
131
134 #ifdef __cplusplus
135 }
136 #endif
137
138 //*****************************************************************************
139 //* Process
140 //*****************************************************************************
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144
149
150 #if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
151
152 typedef pid_t FX_PROCESSID;
153 #else
154
155 typedef FX_DWORD FX_PROCESSID;
156 #endif
157
164
173 void FX_Process_Initialize();
181 void FX_Process_Finalize();
187 FX_PROCESSID FX_Process_GetID();
188
196 FX_LPVOID FX_Process_GetPrivateData(FX_LPVOID key);
207 void FX_Process_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback);
215 void FX_Process_RemovePrivateData(FX_LPVOID key);
216
224 CFX_ProcessContext* FX_Process_GetContext();
225
228 #ifdef __cplusplus
229 }
230 #endif
231
232 //*****************************************************************************
233 //* Thread
234 //*****************************************************************************
235 #ifdef __cplusplus
236 extern "C" {
237 #endif
238
243
245 FX_DEFINEHANDLE(FX_HTHREAD);
246
247 /*
248 #if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
249 typedef pthread_t FX_THREADID;
250 #else
251 typedef FX_DWORD FX_THREADID;
252 #endif
253 */
254
261
263 #define FX_THREADPRIORITY_Lowest -2
264
265 #define FX_THREADPRIORITY_Lower -1
266
267 #define FX_THREADPRIORITY_Normal 0
268
269 #define FX_THREADPRIORITY_Higher 1
270
271 #define FX_THREADPRIORITY_Highest 2
272
279
280 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
281 typedef DWORD FX_ThreadResult;
282 # define THREAD_CALL_CONVENTION WINAPI
283 #else
284 typedef FX_LPVOID FX_ThreadResult;
285 # define THREAD_CALL_CONVENTION
286 #endif
287
295 typedef FX_ThreadResult (THREAD_CALL_CONVENTION *FX_CALLBACK_ThreadProc)(FX_LPVOID param);
296
306 typedef FX_ThreadResult (THREAD_CALL_CONVENTION *FX_CALLBACK_ThreadProxyProc)(FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param);
307
314
320 typedef struct _FX_THREADHANDLER
321 {
323 FX_LPVOID pUserData;
324
336 FX_HTHREAD (*CreateThread)(FX_LPVOID pUserData, FX_INT32 nPriority, size_t szStack, FX_CALLBACK_ThreadProc lpfThreadProc, FX_LPVOID param);
344 FX_BOOL (*ExitThread)(FX_LPVOID pUserData);
352 FX_HTHREAD (*GetCurrentThread)(FX_LPVOID pUserData);
363 void (*Yield)(FX_LPVOID pUserData);
372 FX_INT32 (*GetThreadPriority)(FX_LPVOID pUserData, FX_HTHREAD hThread);
382 void (*SetThreadPriority)(FX_LPVOID pUserData, FX_HTHREAD hThread, FX_INT32 nPriority);
391 FX_INT32 (*WaitForSingleThread)(FX_LPVOID pUserData, FX_HTHREAD hThread);
401 FX_INT32 (*WaitForMultipleThreads)(FX_LPVOID pUserData, const FX_HTHREAD* pThreads, FX_INT32 nCount);
402 }FX_THREADHANDLER;
403
411 FX_THREADHANDLER* FX_Thread_GetHandler();
421 void FX_Thread_SetHandler(FX_THREADHANDLER* pThreadHandler);
422
429
440 FX_HTHREAD FX_Thread_Create(FX_INT32 nPriority, size_t szStack, FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param);
441
447 void FX_Thread_Exit();
448
454 FX_HTHREAD FX_Thread_GetHandle();
455
461 void FX_Thread_Yield();
462
468 FX_INT32 FX_Thread_GetLastError();
476 void FX_Thread_SetLastError(FX_INT32 nErr);
477
485 FX_LPVOID FX_Thread_GetPrivateData(FX_LPVOID key);
496 void FX_Thread_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback);
504 void FX_Thread_RemovePrivateData(FX_LPVOID key);
505
513 FX_INT32 FX_Thread_GetPriority(FX_HTHREAD hThread);
522 void FX_Thread_SetPriority(FX_HTHREAD hThread, FX_INT32 nPriority);
523
531 FX_INT32 FX_Thread_WaitForSingleThread(FX_HTHREAD hThread);
540 FX_INT32 FX_Thread_WaitForMultipleThreads(const FX_HTHREAD* pThreads, FX_INT32 nCount);
541
548
554 CFX_ThreadContext* FX_Thread_GetContext();
555
561 CFX_ExceptionContext* FX_Thread_GetExceptionContext();
562
565 #ifdef __cplusplus
566 }
567 #endif
568
569 //*****************************************************************************
570 //* Cocurrency controls
571 //*****************************************************************************
579
580 #ifdef __cplusplus
581 extern "C" {
582 #endif
583
591 FX_BOOL FX_Mutex_Initialize(FX_MUTEX* pMutex);
599 void FX_Mutex_Destroy(FX_MUTEX* pMutex);
608 FX_BOOL FX_Mutex_TryLock(FX_MUTEX* pMutex);
619 void FX_Mutex_Lock(FX_MUTEX* pMutex);
627 void FX_Mutex_Unlock(FX_MUTEX* pMutex);
628
629 #ifdef __cplusplus
630 }
631 #endif
632
643
644 #ifdef __cplusplus
645 extern "C" {
646 #endif
647
655 FX_BOOL FX_SpinLock_Initialize(FX_SPINLOCK* pSpinLock);
663 void FX_SpinLock_Destroy(FX_SPINLOCK* pSpinLock);
673 FX_BOOL FX_SpinLock_TryLock(FX_SPINLOCK* pSpinLock);
684 void FX_SpinLock_Lock(FX_SPINLOCK* pSpinLock);
692 void FX_SpinLock_Unlock(FX_SPINLOCK* pSpinLock);
700 FX_BOOL FX_SpinLock_IsLocked(FX_SPINLOCK* pSpinLock);
701
702 #ifdef __cplusplus
703 }
704 #endif
705
706 #ifdef _FPDFAPI_MT_
707
709 class CFX_SpinLock
710 {
711 public:
712 CFX_SpinLock() : m_pSpinLock(NULL) {}
713 CFX_SpinLock(FX_SPINLOCK* pSpinLock) : m_pSpinLock(pSpinLock) {if (m_pSpinLock) FX_SpinLock_Lock(m_pSpinLock);}
714 ~CFX_SpinLock() {if (m_pSpinLock) FX_SpinLock_Unlock(m_pSpinLock);}
715
717 FX_BOOL TryLock() {return FX_SpinLock_TryLock(m_pSpinLock);}
719 void Lock() {FX_SpinLock_Lock(m_pSpinLock);}
721 void Unlock() {FX_SpinLock_Unlock(m_pSpinLock);}
723 FX_BOOL IsLocked() {return FX_SpinLock_IsLocked(m_pSpinLock);}
724
725 FX_SPINLOCK* m_pSpinLock;
726 };
727
732 #define FXMT_SPLOCK_THIS CFX_SpinLock _fx_splock((FX_SPINLOCK*)this)
733
737 #define FXMT_SPLOCK_OBJ(lock) CFX_SpinLock _fx_splock(lock)
738
739 #else
740
742 class CFX_SpinLock {};
743 #define FXMT_SPLOCK_THIS
744 #define FXMT_SPLOCK_OBJ(lock)
745
746 #endif
747
757
758 #ifdef __cplusplus
759 extern "C" {
760 #endif
761
769 FX_BOOL FX_RWLock_Initialize(FX_RWLOCK* pRWLock);
777 void FX_RWLock_Destroy(FX_RWLOCK* pRWLock);
787 FX_BOOL FX_RWLock_TryReadLock(FX_RWLOCK* pRWLock);
798 void FX_RWLock_ReadLock(FX_RWLOCK* pRWLock);
806 void FX_RWLock_ReadUnlock(FX_RWLOCK* pRWLock);
816 FX_BOOL FX_RWLock_TryWriteLock(FX_RWLOCK* pRWLock);
827 void FX_RWLock_WriteLock(FX_RWLOCK* pRWLock);
835 void FX_RWLock_WriteUnlock(FX_RWLOCK* pRWLock);
836
837 #ifdef __cplusplus
838 }
839 #endif
840
841 #ifdef _FPDFAPI_MT_
842
843 class CFX_RWLockObject : public CFX_Object
844 {
845 public:
847 CFX_RWLockObject() {FX_RWLock_Initialize(&m_Lock);}
849 ~CFX_RWLockObject() {FX_RWLock_Destroy(&m_Lock);}
850
852 FX_BOOL TryReadLock() {return FX_RWLock_TryReadLock(&m_Lock);}
854 void ReadLock() {FX_RWLock_ReadLock(&m_Lock);}
856 void ReadUnlock() {FX_RWLock_ReadUnlock(&m_Lock);}
858 FX_BOOL TryWriteLock() {return FX_RWLock_TryWriteLock(&m_Lock);}
860 void WriteLock() {FX_RWLock_WriteLock(&m_Lock);}
862 void WriteUnlock() {FX_RWLock_WriteUnlock(&m_Lock);}
863
864 protected:
865 /* Critical section. */
866 FX_RWLOCK m_Lock;
867 friend class CFX_RWLock;
868 };
869
870 class CFX_RWLock
871 {
872 public:
873 CFX_RWLock() : m_pRWLock(NULL), m_nStatus(0) {}
874 CFX_RWLock(FX_RWLOCK* pRWLock, FX_INT32 nStatus) : m_pRWLock(NULL), m_nStatus(0)
875 {
876 Init(pRWLock, nStatus);
877 }
878 CFX_RWLock(CFX_RWLockObject* pRWLockObj, FX_INT32 nStatus) : m_pRWLock(NULL), m_nStatus(0)
879 {
880 Init(&pRWLockObj->m_Lock, nStatus);
881 }
882 ~CFX_RWLock()
883 {
884 if (!m_pRWLock || !m_nStatus) return;
885 if (m_nStatus < 0)
886 FX_RWLock_ReadUnlock(m_pRWLock);
887 else
888 FX_RWLock_WriteUnlock(m_pRWLock);
889 }
890
892 FX_BOOL TryReadLock()
893 {
894 if (FX_RWLock_TryReadLock(m_pRWLock))
895 {
896 m_nStatus = -1;
897 return true;
898 }
899 return false;
900 }
902 void ReadLock()
903 {
904 FX_RWLock_ReadLock(m_pRWLock);
905 m_nStatus = -1;
906 }
908 void ReadUnlock()
909 {
910 m_nStatus = 0;
911 FX_RWLock_ReadUnlock(m_pRWLock);
912 }
914 FX_BOOL TryWriteLock()
915 {
916 if (FX_RWLock_TryWriteLock(m_pRWLock))
917 {
918 m_nStatus = 1;
919 return true;
920 }
921 return false;
922 }
924 void WriteLock()
925 {
926 FX_RWLock_WriteLock(m_pRWLock);
927 m_nStatus = 1;
928 }
930 void WriteUnlock()
931 {
932 m_nStatus = 0;
933 FX_RWLock_WriteUnlock(m_pRWLock);
934 }
935
936 protected:
937 FX_RWLOCK* m_pRWLock;
938 FX_INT32 m_nStatus;
939
940 void Init(FX_RWLOCK* pRWLock, FX_INT32 nStatus)
941 {
942 m_pRWLock = pRWLock, m_nStatus = nStatus;
943 if (!m_pRWLock || !m_nStatus) return;
944 if (m_nStatus < 0)
945 FX_RWLock_ReadLock(m_pRWLock);
946 else
947 FX_RWLock_WriteLock(m_pRWLock);
948 }
949 };
950
952 #define FXMT_RWLOCK_THIS CFX_RWLock _fx_rwlock((CFX_RWLock*)this)
953
954 #define FXMT_RWLOCK_OBJ(lock, s) CFX_RWLock _fx_rwlock(lock, s)
955
956 #define FXMT_RWLOCK_DEFINEOBJ(rwLock, lock, s) CFX_RWLock rwLock(lock, s)
957
959 #define FXMT_RWLOCKOBJECT_DEFINE(rwLockObj) CFX_RWLockObject rwLockObj
960
961 #define FXMT_RWLOCKOBJECT_TRYREADLOCK(lockObj) (lockObj)->TryReadLock()
962
963 #define FXMT_RWLOCKOBJECT_TRYREADLOCK_IF(lockObj) if ((lockObj)->TryReadLock())
964
965 #define FXMT_RWLOCKOBJECT_READLOCK(lockObj) (lockObj)->ReadLock()
966
967 #define FXMT_RWLOCKOBJECT_READUNLOCK(lockObj) (lockObj)->ReadUnlock()
968
969 #define FXMT_RWLOCKOBJECT_TRYWRITELOCK(lockObj) (lockObj)->TryWriteLock()
970
971 #define FXMT_RWLOCKOBJECT_TRYWRITELOCK_IF(lockObj) if ((lockObj)->TryWriteLock())
972
973 #define FXMT_RWLOCKOBJECT_WRITELOCK(lockObj) (lockObj)->WriteLock()
974
975 #define FXMT_RWLOCKOBJECT_WRITEUNLOCK(lockObj) (lockObj)->WriteUnlock()
976 #else
977
979 class CFX_RWLock {};
980 #define FXMT_RWLOCK_THIS
981 #define FXMT_RWLOCK_OBJ(lock, s)
982 #define FXMT_RWLOCK_DEFINEOBJ(rwLock, lock, s)
983
984 #define FXMT_RWLOCKOBJECT_DEFINE(rwLockObj)
985 #define FXMT_RWLOCKOBJECT_TRYREADLOCK(lockObj)
986 #define FXMT_RWLOCKOBJECT_TRYREADLOCK_IF(lockObj)
987 #define FXMT_RWLOCKOBJECT_READLOCK(lockObj)
988 #define FXMT_RWLOCKOBJECT_READUNLOCK(lockObj)
989 #define FXMT_RWLOCKOBJECT_TRYWRITELOCK(lockObj)
990 #define FXMT_RWLOCKOBJECT_TRYWRITELOCK_IF(lockObj)
991 #define FXMT_RWLOCKOBJECT_WRITELOCK(lockObj)
992 #define FXMT_RWLOCKOBJECT_WRITEUNLOCK(lockObj)
993 #endif
994
997 //*****************************************************************************
998 //* Atomic Count
999 //*****************************************************************************
1007
1008 #ifdef __cplusplus
1009 extern "C" {
1010 #endif
1011
1020 FX_INT32 FX_Atom_Add32(volatile FX_INT32* pAddend, FX_INT32 nIncrement);
1029 FX_INT32 FX_Atom_Subtract32(volatile FX_INT32* pAddend, FX_INT32 nDecrement);
1038 FX_INT64 FX_Atom_Add64(volatile FX_INT64* pAddend, FX_INT64 nIncrement);
1047 FX_INT64 FX_Atom_Subtract64(volatile FX_INT64* pAddend, FX_INT64 nDecrement);
1048
1049 #ifdef __cplusplus
1050 }
1051 #endif
1052
1055 #endif /* _FX_PROCESS_H_ */
1056
FX_Thread_GetHandler
FX_THREADHANDLER * FX_Thread_GetHandler()
Get the current thread handler.
CFX_RWLock
Under non-threading mode, defines as empty implementation.
Definition: fx_process.h:979
FX_Thread_Yield
void FX_Thread_Yield()
Yield the processor to another thread.
FX_Mutex_TryLock
FX_BOOL FX_Mutex_TryLock(FX_MUTEX *pMutex)
Try to lock a mutex.
FX_Thread_WaitForMultipleThreads
FX_INT32 FX_Thread_WaitForMultipleThreads(const FX_HTHREAD *pThreads, FX_INT32 nCount)
Wait for termination of multiple threads.
FX_LPVOID
void * FX_LPVOID
Pointer to any type.
Definition: fx_system.h:654
FX_Time_GetLocalTime
void FX_Time_GetLocalTime(FX_SYSTEMTIME *pSystemTime)
Retrieve the current local date and time.
FX_SpinLock_Initialize
FX_BOOL FX_SpinLock_Initialize(FX_SPINLOCK *pSpinLock)
Initialize a spin lock.
FX_Mutex_Initialize
FX_BOOL FX_Mutex_Initialize(FX_MUTEX *pMutex)
Initialize a mutex.
FX_Thread_SetLastError
void FX_Thread_SetLastError(FX_INT32 nErr)
Set the last error code in the current thread.
FX_Thread_SetPrivateData
void FX_Thread_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback)
Set private data in the current thread.
FX_Thread_SetPriority
void FX_Thread_SetPriority(FX_HTHREAD hThread, FX_INT32 nPriority)
Set thread priority.
FX_Atom_Add32
FX_INT32 FX_Atom_Add32(volatile FX_INT32 *pAddend, FX_INT32 nIncrement)
Increase 32-bits integer value.
FXCRT_DATETIMEZONE::day
FX_WORD day
Day of month, from 1 to 31.
Definition: fx_process.h:102
FX_RWLock_TryReadLock
FX_BOOL FX_RWLock_TryReadLock(FX_RWLOCK *pRWLock)
Try to lock for share read.
FX_DWORD
unsigned long FX_DWORD
32-bit unsigned integer.
Definition: fx_system.h:726
FX_Atom_Add64
FX_INT64 FX_Atom_Add64(volatile FX_INT64 *pAddend, FX_INT64 nIncrement)
Increase 64-bits integer value.
FX_Thread_GetPriority
FX_INT32 FX_Thread_GetPriority(FX_HTHREAD hThread)
Get thread priority.
FX_PROCESSID
FX_DWORD FX_PROCESSID
Process ID.
Definition: fx_process.h:155
FX_Thread_GetContext
CFX_ThreadContext * FX_Thread_GetContext()
Get the current thread context.
FX_Atom_Subtract32
FX_INT32 FX_Atom_Subtract32(volatile FX_INT32 *pAddend, FX_INT32 nDecrement)
Decrease 32-bits integer value.
PD_CALLBACK_FREEDATA
void(* PD_CALLBACK_FREEDATA)(FX_LPVOID pData)
Definition: fx_basic.h:3253
FX_RWLock_Initialize
FX_BOOL FX_RWLock_Initialize(FX_RWLOCK *pRWLock)
Initialize a read-write lock.
FXCRT_DATETIMEZONE::milliseconds
FX_WORD milliseconds
Millisecond, from 0 to 999. PDF standard doesn't support now, you can omit this field if it is not ap...
Definition: fx_process.h:112
FX_THREADHANDLER
Thread handler for application extension.
Definition: fx_process.h:320
FX_RWLock_ReadUnlock
void FX_RWLock_ReadUnlock(FX_RWLOCK *pRWLock)
Unlock for share read.
FX_MUTEX
CRITICAL_SECTION FX_MUTEX
Definition for mutex/critical section and read-write lock.
Definition: fx_system.h:1601
FXCRT_DATETIMEZONE::year
FX_WORD year
Year, a four-digit number, such as 2014.
Definition: fx_process.h:98
FX_Process_Initialize
void FX_Process_Initialize()
Initialize process.
FXCRT_DATETIMEZONE
Structure for date and time.
Definition: fx_process.h:95
FX_INT64
__int64 FX_INT64
Signed 64-bit integer.
Definition: fx_system.h:740
FX_RWLock_Destroy
void FX_RWLock_Destroy(FX_RWLOCK *pRWLock)
Destroy a read-write lock.
FXCRT_DATETIMEZONE::second
FX_WORD second
Second, from 0 to 60. 60 for leap second.
Definition: fx_process.h:110
CFX_SpinLock
Under non-threading mode, defines as empty implementation.
Definition: fx_process.h:742
FX_SpinLock_IsLocked
FX_BOOL FX_SpinLock_IsLocked(FX_SPINLOCK *pSpinLock)
Determine whether specified spin lock is locked or not.
FX_INT32
int FX_INT32
32-bit signed integer.
Definition: fx_system.h:683
FX_Atom_Subtract64
FX_INT64 FX_Atom_Subtract64(volatile FX_INT64 *pAddend, FX_INT64 nDecrement)
Decrease 64-bits integer value.
FX_Process_GetID
FX_PROCESSID FX_Process_GetID()
Get the current process ID.
FX_RWLock_WriteLock
void FX_RWLock_WriteLock(FX_RWLOCK *pRWLock)
Lock for exclusive write.
FX_Thread_GetPrivateData
FX_LPVOID FX_Thread_GetPrivateData(FX_LPVOID key)
Get private data in the current thread.
FX_BOOL
int FX_BOOL
Boolean variable (should be TRUE or FALSE).
Definition: fx_system.h:691
FX_Time_GetSystemTime
void FX_Time_GetSystemTime(FX_SYSTEMTIME *pSystemTime)
Retrieve the current system date and time.
FX_Thread_GetExceptionContext
CFX_ExceptionContext * FX_Thread_GetExceptionContext()
Get the current thread exception context.
FX_Thread_SetHandler
void FX_Thread_SetHandler(FX_THREADHANDLER *pThreadHandler)
Set the current thread handler.
FX_THREADHANDLER::pUserData
FX_LPVOID pUserData
Pointer to user data.
Definition: fx_process.h:323
FXCRT_DATETIMEZONE::tzMinute
FX_WORD tzMinute
Minute of time zone, from 0 to 59.
Definition: fx_process.h:120
FX_RWLock_TryWriteLock
FX_BOOL FX_RWLock_TryWriteLock(FX_RWLOCK *pRWLock)
Try to lock for exclusive write.
FX_Process_RemovePrivateData
void FX_Process_RemovePrivateData(FX_LPVOID key)
Remove private data in the current process.
FX_SPINLOCK
void * FX_SPINLOCK
Definition for spinlock.
Definition: fx_system.h:1631
FX_Mutex_Destroy
void FX_Mutex_Destroy(FX_MUTEX *pMutex)
Destroy a mutex.
FXCRT_DATETIMEZONE::hour
FX_WORD hour
Hour, from 0 to 23.
Definition: fx_process.h:106
FX_Process_GetPrivateData
FX_LPVOID FX_Process_GetPrivateData(FX_LPVOID key)
Get private data in the current process.
FX_CALLBACK_ThreadProxyProc
FX_ThreadResult(WINAPI * FX_CALLBACK_ThreadProxyProc)(FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param)
Callback function of thread proxy procedure.
Definition: fx_process.h:306
FX_SpinLock_Destroy
void FX_SpinLock_Destroy(FX_SPINLOCK *pSpinLock)
Destroy a spin lock.
FX_Time_Sleep
FX_DWORD FX_Time_Sleep(FX_DWORD dwMilliseconds)
Delay the current running for specified milliseconds.
FX_SpinLock_Lock
void FX_SpinLock_Lock(FX_SPINLOCK *pSpinLock)
Lock a spin lock.
FX_Mutex_Unlock
void FX_Mutex_Unlock(FX_MUTEX *pMutex)
Unlock a mutex.
FX_Thread_GetLastError
FX_INT32 FX_Thread_GetLastError()
Get the last error code in the current thread.
FXCRT_DATETIMEZONE::dayOfWeek
FX_WORD dayOfWeek
Day of week, from 0 to 6. PDF standard doesn't support now, you can omit this field if it is not appl...
Definition: fx_process.h:104
FXCRT_GetCurrentSystemTime
void FXCRT_GetCurrentSystemTime(FXCRT_DATETIMEZONE &dt)
Get current system date,time and timezone information.
FXCRT_DATETIMEZONE::minute
FX_WORD minute
Minute, from 0 to 59.
Definition: fx_process.h:108
FX_CALLBACK_ThreadProc
FX_ThreadResult(WINAPI * FX_CALLBACK_ThreadProc)(FX_LPVOID param)
Callback function of thread procedure.
Definition: fx_process.h:295
FX_Mutex_Lock
void FX_Mutex_Lock(FX_MUTEX *pMutex)
Lock a mutex.
FX_SpinLock_Unlock
void FX_SpinLock_Unlock(FX_SPINLOCK *pSpinLock)
Unlock a spin lock.
FX_Thread_Create
FX_HTHREAD FX_Thread_Create(FX_INT32 nPriority, size_t szStack, FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param)
Create a new thread.
FX_Thread_RemovePrivateData
void FX_Thread_RemovePrivateData(FX_LPVOID key)
Remove private data in the current thread.
FX_WORD
unsigned short FX_WORD
16-bit unsigned integer.
Definition: fx_system.h:677
FX_Process_GetContext
CFX_ProcessContext * FX_Process_GetContext()
Retrieve process context.
FX_Process_SetPrivateData
void FX_Process_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback)
Set private data in the current process.
FX_Process_Finalize
void FX_Process_Finalize()
Finalize process.
fx_basic.h
Header file for basic data class.
FX_SpinLock_TryLock
FX_BOOL FX_SpinLock_TryLock(FX_SPINLOCK *pSpinLock)
Try to lock a spin lock.
FX_RWLock_WriteUnlock
void FX_RWLock_WriteUnlock(FX_RWLOCK *pRWLock)
Unlock for exclusive write.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
FX_DEFINEHANDLE
#define FX_DEFINEHANDLE(name)
Macro to define a handle type.
Definition: fx_system.h:772
FX_Thread_GetHandle
FX_HTHREAD FX_Thread_GetHandle()
Get the current thread handle.
FXCRT_DATETIMEZONE::tzHour
FX_INT32 tzHour
Hour of time zone, from -12 to 12.
Definition: fx_process.h:118
FX_RWLock_ReadLock
void FX_RWLock_ReadLock(FX_RWLOCK *pRWLock)
Lock for share read.
FX_Thread_WaitForSingleThread
FX_INT32 FX_Thread_WaitForSingleThread(FX_HTHREAD hThread)
Wait for termination of a single thread.
FX_Thread_Exit
void FX_Thread_Exit()
Exit from the current thread.
FXCRT_DATETIMEZONE::month
FX_WORD month
Month, from 1 to 12.
Definition: fx_process.h:100
FX_SYSTEMTIME
Structure of system time.
Definition: fx_process.h:52
FX_Time_GetClock
FX_DWORD FX_Time_GetClock()
Get the clock ticks elapsed by calling process.