UDK 3.2.7 C/C++ API Reference
|
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /************************************************************************* 00003 * 00004 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 00005 * 00006 * Copyright 2000, 2010 Oracle and/or its affiliates. 00007 * 00008 * OpenOffice.org - a multi-platform office productivity suite 00009 * 00010 * This file is part of OpenOffice.org. 00011 * 00012 * OpenOffice.org is free software: you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 3 00014 * only, as published by the Free Software Foundation. 00015 * 00016 * OpenOffice.org is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License version 3 for more details 00020 * (a copy is included in the LICENSE file that accompanied this code). 00021 * 00022 * You should have received a copy of the GNU Lesser General Public License 00023 * version 3 along with OpenOffice.org. If not, see 00024 * <http://www.openoffice.org/license.html> 00025 * for a copy of the LGPLv3 License. 00026 * 00027 ************************************************************************/ 00028 00029 #ifndef _OSL_THREAD_H_ 00030 #define _OSL_THREAD_H_ 00031 00032 #include <osl/time.h> 00033 00034 #ifndef _RTL_TEXTENC_H_ 00035 # include <rtl/textenc.h> 00036 #endif 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00046 typedef void* oslThread; 00047 00050 typedef void (SAL_CALL *oslWorkerFunction)(void*); 00051 00057 typedef enum 00058 { 00059 osl_Thread_PriorityHighest, 00060 osl_Thread_PriorityAboveNormal, 00061 osl_Thread_PriorityNormal, 00062 osl_Thread_PriorityBelowNormal, 00063 osl_Thread_PriorityLowest, 00064 osl_Thread_PriorityUnknown, /* don't use to set */ 00065 osl_Thread_Priority_FORCE_EQUAL_SIZE = SAL_MAX_ENUM 00066 } oslThreadPriority; 00067 00068 00069 typedef sal_uInt32 oslThreadIdentifier; 00070 00071 typedef void* oslThreadKey; 00072 00080 SAL_DLLPUBLIC oslThread SAL_CALL osl_createThread(oslWorkerFunction pWorker, void* pThreadData); 00081 00089 SAL_DLLPUBLIC oslThread SAL_CALL osl_createSuspendedThread(oslWorkerFunction pWorker, void* pThreadData); 00090 00095 SAL_DLLPUBLIC oslThreadIdentifier SAL_CALL osl_getThreadIdentifier(oslThread Thread); 00096 00102 SAL_DLLPUBLIC void SAL_CALL osl_destroyThread(oslThread Thread); 00103 00107 SAL_DLLPUBLIC void SAL_CALL osl_resumeThread(oslThread Thread); 00108 00112 SAL_DLLPUBLIC void SAL_CALL osl_suspendThread(oslThread Thread); 00113 00117 SAL_DLLPUBLIC void SAL_CALL osl_setThreadPriority(oslThread Thread, oslThreadPriority Priority); 00118 00123 SAL_DLLPUBLIC oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread); 00124 00129 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isThreadRunning(const oslThread Thread); 00130 00134 SAL_DLLPUBLIC void SAL_CALL osl_joinWithThread(oslThread Thread); 00135 00139 SAL_DLLPUBLIC void SAL_CALL osl_waitThread(const TimeValue* pDelay); 00140 00144 SAL_DLLPUBLIC void SAL_CALL osl_terminateThread(oslThread Thread); 00145 00152 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_scheduleThread(oslThread Thread); 00153 00161 SAL_DLLPUBLIC void SAL_CALL osl_yieldThread(void); 00162 00173 SAL_DLLPUBLIC void SAL_CALL osl_setThreadName(char const * name); 00174 00175 /* Callback when data stored in a thread key is no longer needed */ 00176 00177 typedef void (SAL_CALL *oslThreadKeyCallbackFunction)(void *); 00178 00180 SAL_DLLPUBLIC oslThreadKey SAL_CALL osl_createThreadKey(oslThreadKeyCallbackFunction pCallback); 00181 00183 SAL_DLLPUBLIC void SAL_CALL osl_destroyThreadKey(oslThreadKey Key); 00184 00186 SAL_DLLPUBLIC void* SAL_CALL osl_getThreadKeyData(oslThreadKey Key); 00187 00189 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setThreadKeyData(oslThreadKey Key, void *pData); 00190 00192 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding(void); 00193 00197 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL osl_setThreadTextEncoding(rtl_TextEncoding Encoding); 00198 00199 #ifdef __cplusplus 00200 } 00201 #endif 00202 00203 #endif /* _OSL_THREAD_H_ */ 00204 00205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */