Changed: Make CWinThread::start more sane, and fixed a typo
This commit is contained in:
parent
d79c56780b
commit
a472f1e741
2 changed files with 4 additions and 1 deletions
|
@ -196,7 +196,7 @@ void CPThread::wait ()
|
||||||
{
|
{
|
||||||
if (_State == ThreadStateRunning)
|
if (_State == ThreadStateRunning)
|
||||||
{
|
{
|
||||||
int error = pthread_join(_ThreadHandle, 0) != 0;
|
int error = pthread_join(_ThreadHandle, 0);
|
||||||
switch (error)
|
switch (error)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -190,6 +190,9 @@ CWinThread::~CWinThread ()
|
||||||
|
|
||||||
void CWinThread::start ()
|
void CWinThread::start ()
|
||||||
{
|
{
|
||||||
|
if (isRunning())
|
||||||
|
throw EThread("Starting a thread that is already started, existing thread will continue running, this should not happen");
|
||||||
|
|
||||||
// ThreadHandle = (void *) ::CreateThread (NULL, _StackSize, ProxyFunc, this, 0, (DWORD *)&ThreadId);
|
// ThreadHandle = (void *) ::CreateThread (NULL, _StackSize, ProxyFunc, this, 0, (DWORD *)&ThreadId);
|
||||||
ThreadHandle = (void *) ::CreateThread (NULL, 0, ProxyFunc, this, 0, (DWORD *)&ThreadId);
|
ThreadHandle = (void *) ::CreateThread (NULL, 0, ProxyFunc, this, 0, (DWORD *)&ThreadId);
|
||||||
// nldebug("NLMISC: thread %x started for runnable '%x'", typeid( Runnable ).name());
|
// nldebug("NLMISC: thread %x started for runnable '%x'", typeid( Runnable ).name());
|
||||||
|
|
Loading…
Reference in a new issue