This class provides functions that you can only apply to the current thread of execution. To obtain a reference to the object, use the static function INonGUIThread::current.
If the current thread of execution owns graphical user interface windows or processes events for such windows, use ICurrentThread instead of this class.
Use these protected constructors to construct objects of this class.
![]() |
public:
virtual ~ICurrentNonGUIThread()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
ICurrentNonGUIThread()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to access general information on the current thread.
![]() |
public:
virtual IThreadHandle handle() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The thread handle and thread ID are identical.
You must use the thread handle for the operating system thread and synchronization functions.
![]() |
public:
virtual IThreadId id() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to perform thread operations that only apply to the current thread.
![]() |
public:
virtual void exit(unsigned long returnCode)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual unsigned long remainingStack() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
This function always returns 1000 because an approximation cannot be obtained.
![]() |
public:
virtual ICurrentNonGUIThread& sleep( unsigned long milliseconds )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
The granularity for sleeping on AIX is in seconds. The number of milliseconds is divided by 1000 to determine the number of seconds the thread will sleep. If the number of milliseconds is less than 1 second, the thread will not sleep.
![]() |
public:
virtual ICurrentNonGUIThread& waitFor( const INonGUIThread& anotherThread )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual ICurrentNonGUIThread& waitFor( const INonGUIThread& anotherThread, long timeout, bool* timedOut )
timeout The number of milliseconds to wait for the other thread to die.
timedOut Filled with true if the operation timed out, else false if the operation succeeded.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual ICurrentNonGUIThread& waitFor( const INonGUIThread& anotherThread, long timeout )
timeout The number of milliseconds to wait for the other thread to die.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual ICurrentNonGUIThread& waitForAllThreads( long timeout = - 1, bool* timedOut = 0 )
IInvalidParameter | is thrown if this function is called from a thread other than the main thread of the process. |
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IThreadId waitForAnyThread(long timeout = - 1)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these methods to control the starting and stopping of threads.
![]() |
public:
virtual void suspend()
If the current thread is supporting a graphical user interface (GUI), use ICurrentThread::suspend instead of this function.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~INonGUIThread()
virtual INonGUIThread& adjustPriority(int delta)
virtual IString asDebugInfo() const
virtual IString asString() const
static int convertedPriority( const int toConvert, INonGUIApplication::PriorityClass& classToSet )
static ICurrentNonGUIThread& current()
static IThreadHandle currentHandle()
static IThreadId currentId()
static unsigned long defaultStackSize()
unsigned long exitCode() const
INonGUIThread( const IThreadId& threadID, const IThreadHandle& threadHandle = IThreadHandle::noHandle )
INonGUIThread(IThreadFn*)
INonGUIThread(const INonGUIThread& thread)
INonGUIThread( OptlinkFnPtr function, void* functionArgument )
INonGUIThread()
INonGUIThread( SystemFnPtr function, unsigned long functionArgument )
virtual bool isStarted() const
virtual INonGUIApplication::PriorityClass priorityClass() const
virtual unsigned priorityLevel() const
virtual void resume()
static void setDefaultStackSize(unsigned long size)
virtual INonGUIThread& setPriority( INonGUIApplication::PriorityClass priority, unsigned level )
virtual INonGUIThread& setStackSize(unsigned long size)
virtual INonGUIThread& setThreadPriority( const INonGUIThread::EThreadPriority newPriority )
INonGUIThread& setVariable( const IString& key, const IString& value )
virtual unsigned long stackSize() const
virtual void start(IThreadFn*)
virtual void start( SystemFnPtr function, unsigned long functionArgument )
virtual void start( OptlinkFnPtr function, void* functionArgument )
virtual void stop()
virtual INonGUIThread::EThreadPriority threadPriority() const
IString variable(const IString& key) const
static IStartedThread* newStartedThread()
INonGUIThread& operator =(const INonGUIThread& thread)
virtual IStartedThread* startedThread() const