20 #ifndef INCLUDED_OSL_THREAD_HXX
21 #define INCLUDED_OSL_THREAD_HXX
41 extern "C" inline void SAL_CALL
threadFunc(
void* param);
56 inline static void * SAL_CALL
operator new(
size_t nSize )
SAL_THROW (())
58 inline static void SAL_CALL
operator delete(
void * pMem )
SAL_THROW (())
60 inline static void * SAL_CALL
operator new( size_t,
void * pMem )
SAL_THROW (())
62 inline static void SAL_CALL
operator delete(
void *,
void * )
SAL_THROW (())
74 assert(m_hThread == 0);
86 assert(m_hThread == 0);
91 return m_hThread != 0;
153 static inline void setName(
char const * name)
throw () {
172 friend void SAL_CALL
threadFunc(
void* param);
174 virtual void SAL_CALL
run() = 0;
SAL_DLLPUBLIC void osl_setThreadName(char const *name)
Attempts to set the name of the current thread.
virtual void resume()
Definition: thread.hxx:100
sal_Bool createSuspended()
Definition: thread.hxx:84
virtual void terminate()
Definition: thread.hxx:106
SAL_DLLPUBLIC oslThreadIdentifier osl_getThreadIdentifier(oslThread Thread)
Get the identifier for the specified thread or if parameter Thread is NULL of the current active thre...
static void yield()
Definition: thread.hxx:148
virtual void join()
Definition: thread.hxx:112
static void wait(const TimeValue &Delay)
Definition: thread.hxx:143
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
void setPriority(oslThreadPriority Priority)
Definition: thread.hxx:122
virtual ~Thread()
Definition: thread.hxx:67
SAL_DLLPUBLIC void osl_waitThread(const TimeValue *pDelay)
Blocks the calling thread at least for the given number of time.
void threadFunc(void *param)
threadFunc is the function which is executed by the threads created by the osl::Thread class...
Definition: thread.hxx:184
SAL_DLLPUBLIC oslThreadPriority osl_getThreadPriority(const oslThread Thread)
Retrieves the threads priority.
sal_uInt32 oslThreadIdentifier
Definition: thread.h:60
void(* oslThreadKeyCallbackFunction)(void *)
Definition: thread.h:168
void * getData()
Get the data associated with the data key.
Definition: thread.hxx:220
ThreadData(oslThreadKeyCallbackFunction pCallback=0)
Create a thread specific local data key.
Definition: thread.hxx:197
SAL_DLLPUBLIC void osl_resumeThread(oslThread Thread)
Wake-up a thread that was suspended with suspend() or createSuspended().
virtual void suspend()
Definition: thread.hxx:94
oslThreadIdentifier getIdentifier() const
Definition: thread.hxx:133
SAL_DLLPUBLIC void osl_destroyThread(oslThread Thread)
Release the thread handle.
SAL_DLLPUBLIC sal_Bool osl_setThreadKeyData(oslThreadKey Key, void *pData)
Set to key associated thread specific data.
virtual void onTerminated()
Definition: thread.hxx:176
SAL_DLLPUBLIC void osl_terminateThread(oslThread Thread)
The requested thread will get terminate the next time scheduleThread() is called. ...
SAL_DLLPUBLIC void osl_yieldThread(void)
Offers the rest of the threads time-slice to the OS.
void * oslThread
Opaque data type for threads.
Definition: thread.h:37
SAL_DLLPUBLIC void osl_suspendThread(oslThread Thread)
Suspend the execution of the thread.
sal_Bool isRunning() const
Definition: thread.hxx:117
oslThreadPriority
levels of thread-priority Note that oslThreadPriorityUnknown might be returned by getPriorityOfThread...
Definition: thread.h:48
SAL_DLLPUBLIC sal_Bool osl_scheduleThread(oslThread Thread)
Offers the rest of the threads time-slice to the OS.
SAL_DLLPUBLIC void * osl_getThreadKeyData(oslThreadKey Key)
Get to key associated thread specific data.
sal_Bool setData(void *pData)
Set the data associated with the data key.
Definition: thread.hxx:211
SAL_DLLPUBLIC void osl_setThreadPriority(oslThread Thread, oslThreadPriority Priority)
Changes the threads priority.
friend void threadFunc(void *param)
The thread functions calls the protected functions run and onTerminated.
Definition: thread.hxx:184
sal_Bool create()
Definition: thread.hxx:72
~ThreadData()
Destroy a thread specific local data key.
Definition: thread.hxx:203
oslThreadPriority getPriority() const
Definition: thread.hxx:128
Thread()
Definition: thread.hxx:65
void * oslThreadKey
Definition: thread.h:62
static oslThreadIdentifier getCurrentIdentifier()
Definition: thread.hxx:138
Definition: thread.hxx:191
unsigned char sal_Bool
Definition: types.h:46
static void setName(char const *name)
Definition: thread.hxx:153
SAL_DLLPUBLIC oslThread osl_createSuspendedThread(oslWorkerFunction pWorker, void *pThreadData)
Create the thread, using the function-ptr pWorker as its main (worker) function.
SAL_DLLPUBLIC void osl_destroyThreadKey(oslThreadKey Key)
Destroy a key to an associated thread local storage pointer.
SAL_DLLPUBLIC oslThreadKey osl_createThreadKey(oslThreadKeyCallbackFunction pCallback)
Create a key to an associated thread local storage pointer.
#define sal_False
Definition: types.h:47
SAL_DLLPUBLIC sal_Bool osl_isThreadRunning(const oslThread Thread)
Returns True if the thread was created and has not terminated yet.
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
A thread abstraction.
Definition: thread.hxx:50
SAL_DLLPUBLIC void osl_joinWithThread(oslThread Thread)
Blocks the calling thread until Thread has terminated.
virtual sal_Bool schedule()
Definition: thread.hxx:157
#define SAL_THROW(exc)
Definition of function throw clause macros.
Definition: types.h:358