/usr/include/oce/OSD_Thread.hxx is in liboce-foundation-dev 0.17.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _OSD_Thread_HeaderFile
#define _OSD_Thread_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <OSD_ThreadFunction.hxx>
#include <OSD_PThread.hxx>
#include <Standard_ThreadId.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Address.hxx>
//! A simple platform-intependent interface to execute
//! and control threads.
class OSD_Thread
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor
Standard_EXPORT OSD_Thread();
//! Initialize the tool by the thread function
//!
//! Note: On Windows, you might have to take an address of the thread
//! function explicitly to pass it to this constructor without compiler error
Standard_EXPORT OSD_Thread(const OSD_ThreadFunction& func);
//! Copy constructor
Standard_EXPORT OSD_Thread(const OSD_Thread& other);
//! Copy thread handle from other OSD_Thread object.
Standard_EXPORT void Assign (const OSD_Thread& other) ;
void operator = (const OSD_Thread& other)
{
Assign(other);
}
//! Destructor. On Windows, closes handle to the thread.
//! On UNIX/Linux, does nothing.
Standard_EXPORT void Destroy() ;
~OSD_Thread()
{
Destroy();
}
Standard_EXPORT void SetPriority (const Standard_Integer thePriority) ;
//! Initialize the tool by the thread function.
//! If the current thread handle is not null, nullifies it.
//!
//! Note: On Windows, you might have to take an address of the thread
//! function explicitly to pass it to this method without compiler error
Standard_EXPORT void SetFunction (const OSD_ThreadFunction& func) ;
//! Starts a thread with thread function given in constructor,
//! passing the specified input data (as void *) to it.
//! The parameter \a WNTStackSize (on Windows only)
//! specifies size of the stack to be allocated for the thread
//! (by default - the same as for the current executable).
//! Returns True if thread started successfully
Standard_EXPORT Standard_Boolean Run (const Standard_Address data = 0, const Standard_Integer WNTStackSize = 0) ;
//! Detaches the execution thread from this Thread object,
//! so that it cannot be waited.
//! Note that mechanics of this operation is different on
//! UNIX/Linux (the thread is put to detached state) and Windows
//! (the handle is closed).
//! However, the purpose is the same: to instruct the system to
//! release all thread data upon its completion.
Standard_EXPORT void Detach() ;
Standard_EXPORT Standard_Boolean Wait() const;
//! Wait till the thread finishes execution.
//! Returns True if wait was successful, False in case of error.
//!
//! If successful and \a result argument is provided, saves the pointer
//! (void*) returned by the thread function in \a result.
//!
//! Note however that it is advisable not to rely upon returned result
//! value, as it is not always the value actually returned by the thread
//! function. In addition, on Windows it is converted via DWORD.
Standard_EXPORT Standard_Boolean Wait (Standard_Address& result) const;
//! Waits for some time and if the thread is finished,
//! it returns the result.
//! The function returns false if the thread is not finished yet.
Standard_EXPORT Standard_Boolean Wait (const Standard_Integer time, Standard_Address& result) const;
//! Returns ID of the currently controlled thread ID,
//! or 0 if no thread is run
Standard_EXPORT Standard_ThreadId GetId() const;
//! Auxiliary: returns ID of the current thread
Standard_EXPORT static Standard_ThreadId Current() ;
protected:
private:
OSD_ThreadFunction myFunc;
OSD_PThread myThread;
Standard_ThreadId myThreadId;
Standard_Integer myPriority;
};
#endif // _OSD_Thread_HeaderFile
|