From 92745e6249cdbc43c78ae2e7376b36c541268542 Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 3 Oct 2013 23:52:35 +0000 Subject: [PATCH] Work around a POSIX violation. git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31114 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/thread_validity_09.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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