Foxit PDF SDK

fx_process.h
浏览该文件的文档.
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 //外部类
35 class CFX_ProcessContext;
36 class CFX_ThreadContext;
37 class CFX_ExceptionContext;
38
39 //*****************************************************************************
40 //* 时间
41 //*****************************************************************************
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
50
52 typedef struct _FX_SYSTEMTIME
53 {
54 FX_WORD wYear; //年
55 FX_WORD wMonth; //月，1 - 12
56 FX_WORD wDayOfWeek; //星期几，星期日为0，星期一为1，...
57 FX_WORD wDay; //月中的日，从1开始 - 31
58 FX_WORD wHour; //小时，0 - 23
59 FX_WORD wMinute; //分钟，0 - 59
60 FX_WORD wSecond; //秒，0 - 59
61 FX_WORD wMilliseconds; //毫秒，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 //* 进程
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 //* 线程
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 //* 并发控制
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 /* 临界区。 */
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 //* 原子计数
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_Mutex_Unlock
void FX_Mutex_Unlock(FX_MUTEX *pMutex)
解锁一个互斥量。
FX_DWORD
unsigned long FX_DWORD
32位无符号整数。
Definition: fx_system.h:726
FX_SpinLock_IsLocked
FX_BOOL FX_SpinLock_IsLocked(FX_SPINLOCK *pSpinLock)
确定指定的自旋锁是否被锁定。
FXCRT_DATETIMEZONE::month
FX_WORD month
月，从1到12。
Definition: fx_process.h:100
FX_RWLock_WriteUnlock
void FX_RWLock_WriteUnlock(FX_RWLOCK *pRWLock)
解锁以进行独占写入。
FX_CALLBACK_ThreadProc
FX_ThreadResult(WINAPI * FX_CALLBACK_ThreadProc)(FX_LPVOID param)
线程过程的回调函数。
Definition: fx_process.h:295
FX_Thread_Exit
void FX_Thread_Exit()
退出当前线程。
FX_Process_Initialize
void FX_Process_Initialize()
初始化进程。
PD_CALLBACK_FREEDATA
void(* PD_CALLBACK_FREEDATA)(FX_LPVOID pData)
Definition: fx_basic.h:3232
FXCRT_DATETIMEZONE::year
FX_WORD year
年，四位数字，如2014。
Definition: fx_process.h:98
FX_RWLock_WriteLock
void FX_RWLock_WriteLock(FX_RWLOCK *pRWLock)
锁定以进行独占写入。
FX_SpinLock_Destroy
void FX_SpinLock_Destroy(FX_SPINLOCK *pSpinLock)
销毁一个自旋锁。
FX_Thread_GetHandle
FX_HTHREAD FX_Thread_GetHandle()
获取当前线程句柄。
FX_Process_RemovePrivateData
void FX_Process_RemovePrivateData(FX_LPVOID key)
移除当前进程中的私有数据。
FX_THREADHANDLER
应用程序扩展的线程处理器。
Definition: fx_process.h:320
FX_THREADHANDLER::pUserData
FX_LPVOID pUserData
指向用户数据的指针。
Definition: fx_process.h:323
FX_Atom_Add64
FX_INT64 FX_Atom_Add64(volatile FX_INT64 *pAddend, FX_INT64 nIncrement)
增加64位整数值。
FX_SpinLock_TryLock
FX_BOOL FX_SpinLock_TryLock(FX_SPINLOCK *pSpinLock)
尝试锁定一个自旋锁。
FX_RWLock_TryWriteLock
FX_BOOL FX_RWLock_TryWriteLock(FX_RWLOCK *pRWLock)
尝试锁定以进行独占写入。
FX_RWLock_Destroy
void FX_RWLock_Destroy(FX_RWLOCK *pRWLock)
销毁一个读写锁。
FX_Thread_Yield
void FX_Thread_Yield()
将处理器让出给另一个线程。
FX_Thread_WaitForSingleThread
FX_INT32 FX_Thread_WaitForSingleThread(FX_HTHREAD hThread)
等待单个线程终止。
FXCRT_DATETIMEZONE::milliseconds
FX_WORD milliseconds
毫秒，从0到999。PDF标准现在不支持，如果不适用可以省略此字段。
Definition: fx_process.h:112
FX_Thread_WaitForMultipleThreads
FX_INT32 FX_Thread_WaitForMultipleThreads(const FX_HTHREAD *pThreads, FX_INT32 nCount)
等待多个线程终止。
FX_Process_GetContext
CFX_ProcessContext * FX_Process_GetContext()
获取进程上下文。
FX_SYSTEMTIME
系统时间结构。
Definition: fx_process.h:52
FX_Atom_Subtract64
FX_INT64 FX_Atom_Subtract64(volatile FX_INT64 *pAddend, FX_INT64 nDecrement)
减少64位整数值。
FXCRT_DATETIMEZONE::tzMinute
FX_WORD tzMinute
时区的分钟，从0到59。
Definition: fx_process.h:120
FX_SpinLock_Unlock
void FX_SpinLock_Unlock(FX_SPINLOCK *pSpinLock)
解锁一个自旋锁。
FX_LPVOID
void * FX_LPVOID
指向任意类型的指针。
Definition: fx_system.h:654
FX_Thread_GetPriority
FX_INT32 FX_Thread_GetPriority(FX_HTHREAD hThread)
获取线程优先级。
FX_Thread_GetPrivateData
FX_LPVOID FX_Thread_GetPrivateData(FX_LPVOID key)
获取当前线程中的私有数据。
FX_DEFINEHANDLE
#define FX_DEFINEHANDLE(name)
定义句柄类型的宏。
Definition: fx_system.h:772
FX_Mutex_Destroy
void FX_Mutex_Destroy(FX_MUTEX *pMutex)
销毁一个互斥量。
FX_SPINLOCK
void * FX_SPINLOCK
自旋锁的定义。
Definition: fx_system.h:1631
FX_INT32
int FX_INT32
32位有符号整数。
Definition: fx_system.h:683
FX_Mutex_TryLock
FX_BOOL FX_Mutex_TryLock(FX_MUTEX *pMutex)
尝试锁定一个互斥量。
FXCRT_DATETIMEZONE::second
FX_WORD second
秒，从0到60。60表示闰秒。
Definition: fx_process.h:110
FX_Thread_SetLastError
void FX_Thread_SetLastError(FX_INT32 nErr)
设置当前线程中的最后错误代码。
FX_Thread_GetExceptionContext
CFX_ExceptionContext * FX_Thread_GetExceptionContext()
获取当前线程异常上下文。
FX_Thread_RemovePrivateData
void FX_Thread_RemovePrivateData(FX_LPVOID key)
移除当前线程中的私有数据。
FX_RWLock_ReadLock
void FX_RWLock_ReadLock(FX_RWLOCK *pRWLock)
锁定以进行共享读取。
FX_RWLock_ReadUnlock
void FX_RWLock_ReadUnlock(FX_RWLOCK *pRWLock)
解锁以进行共享读取。
FXCRT_DATETIMEZONE::minute
FX_WORD minute
分钟，从0到59。
Definition: fx_process.h:108
FX_RWLock_Initialize
FX_BOOL FX_RWLock_Initialize(FX_RWLOCK *pRWLock)
初始化读写锁。
FX_Thread_Create
FX_HTHREAD FX_Thread_Create(FX_INT32 nPriority, size_t szStack, FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param)
创建一个新线程。
FX_Time_GetSystemTime
void FX_Time_GetSystemTime(FX_SYSTEMTIME *pSystemTime)
获取当前系统日期和时间。
FX_Mutex_Initialize
FX_BOOL FX_Mutex_Initialize(FX_MUTEX *pMutex)
初始化一个互斥量。
FX_Process_GetPrivateData
FX_LPVOID FX_Process_GetPrivateData(FX_LPVOID key)
获取当前进程中的私有数据。
FX_Time_Sleep
FX_DWORD FX_Time_Sleep(FX_DWORD dwMilliseconds)
延迟当前运行指定的毫秒数。
FX_Thread_GetLastError
FX_INT32 FX_Thread_GetLastError()
获取当前线程中的最后错误代码。
FX_Thread_SetHandler
void FX_Thread_SetHandler(FX_THREADHANDLER *pThreadHandler)
设置当前线程处理器。
FXCRT_DATETIMEZONE::day
FX_WORD day
月中的日，从1到31。
Definition: fx_process.h:102
FX_WORD
unsigned short FX_WORD
16位无符号整数。
Definition: fx_system.h:677
FX_Atom_Add32
FX_INT32 FX_Atom_Add32(volatile FX_INT32 *pAddend, FX_INT32 nIncrement)
增加32位整数值。
FX_Process_SetPrivateData
void FX_Process_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback)
设置当前进程中的私有数据。
FX_SpinLock_Initialize
FX_BOOL FX_SpinLock_Initialize(FX_SPINLOCK *pSpinLock)
初始化自旋锁。
FX_Thread_SetPrivateData
void FX_Thread_SetPrivateData(FX_LPVOID key, FX_LPVOID data, PD_CALLBACK_FREEDATA callback)
设置当前线程中的私有数据。
NULL
#define NULL
空指针值。
Definition: fx_system.h:792
FX_Atom_Subtract32
FX_INT32 FX_Atom_Subtract32(volatile FX_INT32 *pAddend, FX_INT32 nDecrement)
减少32位整数值。
FXCRT_DATETIMEZONE::hour
FX_WORD hour
小时，从0到23。
Definition: fx_process.h:106
FX_Mutex_Lock
void FX_Mutex_Lock(FX_MUTEX *pMutex)
锁定一个互斥量。
FX_BOOL
int FX_BOOL
布尔变量（应为TRUE或FALSE）。
Definition: fx_system.h:691
FXCRT_DATETIMEZONE::tzHour
FX_INT32 tzHour
时区的小时，从-12到12。
Definition: fx_process.h:118
fx_basic.h
基本数据类的头文件。
FXCRT_DATETIMEZONE
日期和时间结构。
Definition: fx_process.h:95
CFX_RWLock
在非线程模式下，定义为空实现。
Definition: fx_process.h:979
FX_SpinLock_Lock
void FX_SpinLock_Lock(FX_SPINLOCK *pSpinLock)
锁定一个自旋锁。
FX_Thread_GetHandler
FX_THREADHANDLER * FX_Thread_GetHandler()
获取当前线程处理器。
FX_RWLock_TryReadLock
FX_BOOL FX_RWLock_TryReadLock(FX_RWLOCK *pRWLock)
尝试锁定以进行共享读取。
FXCRT_GetCurrentSystemTime
void FXCRT_GetCurrentSystemTime(FXCRT_DATETIMEZONE &dt)
获取当前系统日期、时间和时区信息。
FX_Time_GetLocalTime
void FX_Time_GetLocalTime(FX_SYSTEMTIME *pSystemTime)
获取当前本地日期和时间。
FX_Process_GetID
FX_PROCESSID FX_Process_GetID()
获取当前进程ID
FX_Thread_SetPriority
void FX_Thread_SetPriority(FX_HTHREAD hThread, FX_INT32 nPriority)
设置线程优先级。
FX_Time_GetClock
FX_DWORD FX_Time_GetClock()
获取调用进程已消耗的时钟周期。
FX_MUTEX
CRITICAL_SECTION FX_MUTEX
互斥锁/临界区和读写锁的定义。
Definition: fx_system.h:1600
FX_CALLBACK_ThreadProxyProc
FX_ThreadResult(WINAPI * FX_CALLBACK_ThreadProxyProc)(FX_CALLBACK_ThreadProc threadProc, FX_LPVOID param)
线程代理过程的回调函数。
Definition: fx_process.h:306
FX_Process_Finalize
void FX_Process_Finalize()
结束进程。
FX_PROCESSID
FX_DWORD FX_PROCESSID
进程ID。
Definition: fx_process.h:155
FX_Thread_GetContext
CFX_ThreadContext * FX_Thread_GetContext()
获取当前线程上下文。
CFX_SpinLock
在非线程模式下，定义为空实现。
Definition: fx_process.h:742
FXCRT_DATETIMEZONE::dayOfWeek
FX_WORD dayOfWeek
星期几，从0到6。PDF标准现在不支持，如果不适用可以省略此字段。
Definition: fx_process.h:104