A little cleanup. Moved class to SmartPtr.cpp and SmartPtr.h files.
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1110 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
80a07d19e8
commit
16094ffe39
16 changed files with 450 additions and 344 deletions
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#include <process.h>
|
||||
//#include <process.h>
|
||||
#if !defined( _MSC_VER )
|
||||
#include <unistd.h> // needed for the usleep function.
|
||||
#endif
|
||||
|
@ -86,11 +86,13 @@ Thread::~Thread( void )
|
|||
bool Thread::WaitForThread( void ) volatile
|
||||
{
|
||||
assert( IsValid( m_owner ) );
|
||||
|
||||
const volatile Thread * current = Thread::GetCurrentThread();
|
||||
if ( this == current )
|
||||
return false;
|
||||
if ( m_status == Thread::Dead )
|
||||
return false;
|
||||
|
||||
while ( this->m_status == Thread::Active )
|
||||
{
|
||||
// Call the wait policy.
|
||||
|
@ -100,6 +102,8 @@ bool Thread::WaitForThread( void ) volatile
|
|||
::usleep( 1000 );
|
||||
#endif
|
||||
}
|
||||
|
||||
m_status = Thread::Idle;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue