30 #ifndef _CPL_MULTIPROC_H_INCLUDED_
31 #define _CPL_MULTIPROC_H_INCLUDED_
42 #if defined(WIN32) && !defined(CPL_MULTIPROC_STUB)
43 # define CPL_MULTIPROC_WIN32
46 # undef CPL_MULTIPROC_PTHREAD
49 #if !defined(CPL_MULTIPROC_WIN32) && !defined(CPL_MULTIPROC_PTHREAD) \
50 && !defined(CPL_MULTIPROC_STUB) && !defined(CPL_MULTIPROC_NONE)
51 # define CPL_MULTIPROC_STUB
56 typedef void (*CPLThreadFunc)(
void *);
58 void CPL_DLL *CPLLockFile(
const char *pszPath,
double dfWaitInSeconds );
59 void CPL_DLL CPLUnlockFile(
void *hLock );
61 void CPL_DLL *CPLCreateMutex();
62 int CPL_DLL CPLCreateOrAcquireMutex(
void **,
double dfWaitInSeconds );
63 int CPL_DLL CPLAcquireMutex(
void *hMutex,
double dfWaitInSeconds );
64 void CPL_DLL CPLReleaseMutex(
void *hMutex );
65 void CPL_DLL CPLDestroyMutex(
void *hMutex );
66 void CPL_DLL CPLCleanupMasterMutex();
68 void CPL_DLL *CPLCreateCond();
69 void CPL_DLL CPLCondWait(
void *hCond,
void* hMutex );
70 void CPL_DLL CPLCondSignal(
void *hCond );
71 void CPL_DLL CPLCondBroadcast(
void *hCond );
72 void CPL_DLL CPLDestroyCond(
void *hCond );
74 GIntBig CPL_DLL CPLGetPID();
75 int CPL_DLL CPLCreateThread( CPLThreadFunc pfnMain,
void *pArg );
76 void CPL_DLL* CPLCreateJoinableThread( CPLThreadFunc pfnMain,
void *pArg );
77 void CPL_DLL CPLJoinThread(
void* hJoinableThread);
78 void CPL_DLL CPLSleep(
double dfWaitInSeconds );
80 const char CPL_DLL *CPLGetThreadingModel();
82 int CPL_DLL CPLGetNumCPUs();
88 #define CPLMutexHolderD(x) CPLMutexHolder oHolder(x,1000.0,__FILE__,__LINE__);
100 const char *pszFile = __FILE__,
101 int nLine = __LINE__ );
110 #define CTLS_RLBUFFERINFO 1
111 #define CTLS_WIN32_COND 2
112 #define CTLS_CSVTABLEPTR 3
113 #define CTLS_CSVDEFAULTFILENAME 4
114 #define CTLS_ERRORCONTEXT 5
115 #define CTLS_GDALDATASET_REC_PROTECT_MAP 6
116 #define CTLS_PATHBUF 7
117 #define CTLS_UNUSED3 8
118 #define CTLS_UNUSED4 9
119 #define CTLS_CPLSPRINTF 10
120 #define CTLS_RESPONSIBLEPID 11
121 #define CTLS_VERSIONINFO 12
122 #define CTLS_VERSIONINFO_LICENCE 13
123 #define CTLS_CONFIGOPTIONS 14
124 #define CTLS_FINDFILE 15
129 void CPL_DLL * CPLGetTLS(
int nIndex );
130 void CPL_DLL CPLSetTLS(
int nIndex,
void *pData,
int bFreeOnExit );
134 typedef void (*CPLTLSFreeFunc)(
void* pData );
135 void CPL_DLL CPLSetTLSWithFreeFunc(
int nIndex,
void *pData, CPLTLSFreeFunc pfnFree );
137 void CPL_DLL CPLCleanupTLS();