syncing commonlibs with Many thanks to Michael Iedema for these patches, makes config a lot better.

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@5655 19bc5d8c-e614-43d4-8b26-e1612bc8e597
diff --git a/CommonLibs/Threads.h b/CommonLibs/Threads.h
index eba8e89..a38a73a 100644
--- a/CommonLibs/Threads.h
+++ b/CommonLibs/Threads.h
@@ -155,12 +155,16 @@
 	public:
 
 	/** Create a thread in a non-running state. */
-	Thread(size_t wStackSize = (65536*4)):mThread((pthread_t)0) { mStackSize=wStackSize;}
+	Thread(size_t wStackSize = (65536*4)):mThread((pthread_t)0) {
+		pthread_attr_init(&mAttrib);	// (pat) moved this here.
+		mStackSize=wStackSize;
+	}
 
 	/**
 		Destroy the Thread.
 		It should be stopped and joined.
 	*/
+	// (pat) If the Thread is destroyed without being started, then mAttrib is undefined.  Oops.
 	~Thread() { pthread_attr_destroy(&mAttrib); }
 
 
@@ -168,7 +172,7 @@
 	void start(void *(*task)(void*), void *arg);
 
 	/** Join a thread that will stop on its own. */
-	void join() { int s = pthread_join(mThread,NULL); assert(!s); }
+	void join() { int s = pthread_join(mThread,NULL); assert(!s); mThread = 0; }
 
 };