UDK 3.2.7 C/C++ API Reference

osl/thread.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*
00003  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
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,         /* don't use to set */
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 /* Callback when data stored in a thread key is no longer needed */
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  /* _OSL_THREAD_H_ */
00195 
00196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines