Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PThread * PThread::Current (  )  [static, inherited]

Get the currently running thread object instance. It is possible, even likely, that the smae code may be executed in the context of differenct threads. Under some circumstances it may be necessary to know what the current codes thread is and this static function provides that information.

Returns:
pointer to current thread.

Reimplemented in PProcess, and PServiceProcess.

Definition at line 1489 of file win32.cxx.

References PProcess::Current().

Referenced by PTrace::Begin(), PTrace::Block::Block(), PVideoInputDevice_1394DC::GetFrameData(), PVideoInputDevice_1394AVC::GetFrameData(), PThread::IsTerminated(), PSystemLog::Output(), PChannel::SendCommandString(), PThread::Terminate(), PServiceProcess::Terminate(), PThread::WaitForTermination(), and PTrace::Block::~Block().

{
  PProcess & process = PProcess::Current();
  process.activeThreadMutex.Wait();
  PThread * thread = process.activeThreads.GetAt(GetCurrentThreadId());
  process.activeThreadMutex.Signal();
  return thread;
}


Generated by  Doxygen 1.6.0   Back to index