[Assorted-commits] SF.net SVN: assorted: [742] cpp-commons/trunk/src/commons/boost/threads.h
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-05-08 19:25:16
|
Revision: 742 http://assorted.svn.sourceforge.net/assorted/?rev=742&view=rev Author: yangzhang Date: 2008-05-08 12:25:04 -0700 (Thu, 08 May 2008) Log Message: ----------- refactored delegates into delegates.h Modified Paths: -------------- cpp-commons/trunk/src/commons/boost/threads.h Modified: cpp-commons/trunk/src/commons/boost/threads.h =================================================================== --- cpp-commons/trunk/src/commons/boost/threads.h 2008-05-08 19:24:40 UTC (rev 741) +++ cpp-commons/trunk/src/commons/boost/threads.h 2008-05-08 19:25:04 UTC (rev 742) @@ -9,6 +9,7 @@ #include <boost/function.hpp> #include <commons/check.h> +#include <commons/boost/delegates.h> #include <commons/threads.h> namespace commons @@ -17,18 +18,6 @@ using namespace boost; /** - * Helper for launching new threads. - */ - void* - run_function0(void* p) - { - const function0<void>* pf = (const function0<void>*) p; - (*pf)(); - delete pf; - return NULL; - } - - /** * Run a function in pthread. * \return The new pthread_t on success, 0 on failure. * TODO: Is it safe to treat the pthread_t as an integral type? @@ -37,7 +26,7 @@ spawn(const function0<void>& f) { pthread_t t; - return pthread_create(&t, NULL, &run_function0, (void*) new function0<void>(f)) == 0 ? t : 0; + return pthread_create(&t, NULL, &run_function0_null, (void*) new function0<void>(f)) == 0 ? t : 0; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |