src/thread_pthread.cpp
branchNewGRF_ports
changeset 10991 d8811e327d12
parent 10724 68a692eacf22
child 10994 cd9968b6f96b
--- a/src/thread_pthread.cpp	Tue May 27 00:50:55 2008 +0000
+++ b/src/thread_pthread.cpp	Tue Jun 17 10:32:49 2008 +0000
@@ -95,18 +95,15 @@
 		throw 0;
 	}
 
-	/* virtual */ void *Join()
+	/* virtual */ void Join()
 	{
 		/* You cannot join yourself */
 		assert(!IsCurrent());
 
-		void *ret;
-		pthread_join(m_thr, &ret);
+		pthread_join(m_thr, NULL);
 		m_thr = 0;
 
 		delete this;
-
-		return ret;
 	}
 
 	/* virtual */ bool IsCurrent()
@@ -126,14 +123,15 @@
 	 */
 	static void *stThreadProc(void *thr)
 	{
-		return ((ThreadObject_pthread *)thr)->ThreadProc();
+		((ThreadObject_pthread *)thr)->ThreadProc();
+		pthread_exit(NULL);
 	}
 
 	/**
 	 * A new thread is created, and this function is called. Call the custom
 	 *  function of the creator of the thread.
 	 */
-	void *ThreadProc()
+	void ThreadProc()
 	{
 		/* The new thread stops here so the calling thread can complete pthread_create() call */
 		sem_wait(&m_sem_start);
@@ -152,8 +150,6 @@
 		sem_post(&m_sem_stop);
 
 		if (exit) delete this;
-
-		pthread_exit(NULL);
 	}
 };