00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OSL_THREAD_H_
00021 #define _OSL_THREAD_H_
00022
00023 #include "sal/config.h"
00024
00025 #include "osl/time.h"
00026 #include "rtl/textenc.h"
00027 #include "sal/saldllapi.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00037 typedef void* oslThread;
00038
00041 typedef void (SAL_CALL *oslWorkerFunction)(void*);
00042
00048 typedef enum
00049 {
00050 osl_Thread_PriorityHighest,
00051 osl_Thread_PriorityAboveNormal,
00052 osl_Thread_PriorityNormal,
00053 osl_Thread_PriorityBelowNormal,
00054 osl_Thread_PriorityLowest,
00055 osl_Thread_PriorityUnknown,
00056 osl_Thread_Priority_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
00057 } oslThreadPriority;
00058
00059
00060 typedef sal_uInt32 oslThreadIdentifier;
00061
00062 typedef void* oslThreadKey;
00063
00071 SAL_DLLPUBLIC oslThread SAL_CALL osl_createThread(oslWorkerFunction pWorker, void* pThreadData);
00072
00080 SAL_DLLPUBLIC oslThread SAL_CALL osl_createSuspendedThread(oslWorkerFunction pWorker, void* pThreadData);
00081
00086 SAL_DLLPUBLIC oslThreadIdentifier SAL_CALL osl_getThreadIdentifier(oslThread Thread);
00087
00093 SAL_DLLPUBLIC void SAL_CALL osl_destroyThread(oslThread Thread);
00094
00098 SAL_DLLPUBLIC void SAL_CALL osl_resumeThread(oslThread Thread);
00099
00103 SAL_DLLPUBLIC void SAL_CALL osl_suspendThread(oslThread Thread);
00104
00108 SAL_DLLPUBLIC void SAL_CALL osl_setThreadPriority(oslThread Thread, oslThreadPriority Priority);
00109
00114 SAL_DLLPUBLIC oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread);
00115
00120 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isThreadRunning(const oslThread Thread);
00121
00125 SAL_DLLPUBLIC void SAL_CALL osl_joinWithThread(oslThread Thread);
00126
00130 SAL_DLLPUBLIC void SAL_CALL osl_waitThread(const TimeValue* pDelay);
00131
00135 SAL_DLLPUBLIC void SAL_CALL osl_terminateThread(oslThread Thread);
00136
00143 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread);
00144
00152 SAL_DLLPUBLIC void SAL_CALL osl_yieldThread(void);
00153
00164 SAL_DLLPUBLIC void SAL_CALL osl_setThreadName(char const * name);
00165
00166
00167
00168 typedef void (SAL_CALL *oslThreadKeyCallbackFunction)(void *);
00169
00171 SAL_DLLPUBLIC oslThreadKey SAL_CALL osl_createThreadKey(oslThreadKeyCallbackFunction pCallback);
00172
00174 SAL_DLLPUBLIC void SAL_CALL osl_destroyThreadKey(oslThreadKey Key);
00175
00177 SAL_DLLPUBLIC void* SAL_CALL osl_getThreadKeyData(oslThreadKey Key);
00178
00180 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setThreadKeyData(oslThreadKey Key, void *pData);
00181
00183 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding(void);
00184
00188 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL osl_setThreadTextEncoding(rtl_TextEncoding Encoding);
00189
00190 #ifdef __cplusplus
00191 }
00192 #endif
00193
00194 #endif
00195
00196