From: bangerth Date: Thu, 3 Oct 2013 23:52:35 +0000 (+0000) Subject: Work around a POSIX violation. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92745e6249cdbc43c78ae2e7376b36c541268542;p=dealii-svn.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