aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-03-24 17:17:50 +0100
committerMartin Willi <martin@revosec.ch>2014-04-01 14:28:54 +0200
commit4e8ff4f010f95ca5d6e36e5e0659d4a7d0f61d35 (patch)
tree2783028146b0e4319e2a7b279b22518ce6633e2d /src
parent96e3142c39a69cfc99fc808f2df3f9d409b05357 (diff)
downloadstrongswan-4e8ff4f010f95ca5d6e36e5e0659d4a7d0f61d35.tar.bz2
strongswan-4e8ff4f010f95ca5d6e36e5e0659d4a7d0f61d35.tar.xz
unit-tests: Prevent a failing worker thread to go wild after it fails
A worker raises SIGUSR1 to inform the main thread that the test fails. The main thread then starts cancelling workers, but the offending thread should be terminated immediately to prevent it from test continuation.
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/tests/test_suite.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstrongswan/tests/test_suite.c b/src/libstrongswan/tests/test_suite.c
index 0f2e74b7c..fb40b05c1 100644
--- a/src/libstrongswan/tests/test_suite.c
+++ b/src/libstrongswan/tests/test_suite.c
@@ -136,7 +136,8 @@ static inline void test_failure()
else
{
pthread_kill(main_thread, SIGUSR1);
- /* how can we stop just the thread? longjmp to a restore point? */
+ /* terminate thread to prevent it from going wild */
+ pthread_exit(NULL);
}
}