From: Wolfgang Bangerth Date: Thu, 3 Oct 2013 23:52:35 +0000 (+0000) Subject: Work around a POSIX violation. X-Git-Tag: v8.1.0~570^2~117 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eda9043f58b4622bcaa57d66cf8ef4d3cc15dfc;p=dealii.git Work around a POSIX violation. git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31114 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/thread_validity_09.cc b/tests/base/thread_validity_09.cc index 3daddafba0..60d3247d9c 100644 --- a/tests/base/thread_validity_09.cc +++ b/tests/base/thread_validity_09.cc @@ -34,9 +34,15 @@ int spin_lock = 0; int worker () { + // wait till the main thread has actually done its work -- we will + // hang in the 'acquire' line until the main thread releases the + // mutex. release the mutex again at the end of this function since + // mutices can only be relased on the same thread as they are + // acquired on. mutex.acquire (); deallog << "OK." << std::endl; spin_lock = 1; + mutex.release (); return 42; } @@ -60,11 +66,12 @@ int main() for (unsigned int i=0; i