|
From: <axl...@us...> - 2008-12-13 00:18:17
|
Revision: 73
http://hgengine.svn.sourceforge.net/hgengine/?rev=73&view=rev
Author: axlecrusher
Date: 2008-12-13 00:18:15 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
update
Modified Paths:
--------------
Mercury2/src/MercuryThreads.cpp
Mercury2/src/MercuryThreads.h
Modified: Mercury2/src/MercuryThreads.cpp
===================================================================
--- Mercury2/src/MercuryThreads.cpp 2008-12-13 00:15:43 UTC (rev 72)
+++ Mercury2/src/MercuryThreads.cpp 2008-12-13 00:18:15 UTC (rev 73)
@@ -44,7 +44,7 @@
}
#endif
-int MercuryThread::Create( void * (*fn)(void *), void *data )
+int MercuryThread::Create( void * (*fn)(void *), void *data, bool detach )
{
#if defined( WIN32 )
mkThreadData = new StartThreadData;
@@ -59,7 +59,8 @@
return false;
else
{
- pthread_detach( m_thread ); //reclaim memory on thread destruction
+ if (detach)
+ pthread_detach( m_thread ); //reclaim memory on thread destruction
return true;
}
#endif
Modified: Mercury2/src/MercuryThreads.h
===================================================================
--- Mercury2/src/MercuryThreads.h 2008-12-13 00:15:43 UTC (rev 72)
+++ Mercury2/src/MercuryThreads.h 2008-12-13 00:18:15 UTC (rev 73)
@@ -24,7 +24,7 @@
~MercuryThread();
///Create a thread of function fn and pass it data *data.
- int Create( void * (*fn)(void *), void *data );
+ int Create( void * (*fn)(void *), void *data, bool detach = true );
///Wait for the thread to complete.
int Wait( long lMilliseconds = 10000000 );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|