posix-threads.cc (park): Rewrite code to handle time.

2009-11-17  Andrew Haley  <aph@redhat.com>

	* posix-threads.cc (park): Rewrite code to handle time.
	Move mutex lock before the call to compare_and_swap to avoid a
	race condition.
	Add some assertions.
	(unpark): Add an assertion.
	(init): Move here from posix-threads.h.
	* include/posix-threads.h (destroy): removed.

From-SVN: r154265
This commit is contained in:
Andrew Haley
2009-11-17 18:05:00 +00:00
committed by Andrew Haley
parent 37740cd3af
commit 6bab028494
3 changed files with 66 additions and 41 deletions
-7
View File
@@ -374,13 +374,6 @@ struct ParkHelper
void unpark ();
};
inline void
ParkHelper::init ()
{
pthread_mutex_init (&mutex, NULL);
pthread_cond_init (&cond, NULL);
}
inline void
ParkHelper::destroy ()
{