From ebdc876c9b98c7b9ace347fd7f38b956b4aa41ca Mon Sep 17 00:00:00 2001 From: John Cortell Date: Thu, 4 Mar 2010 22:14:37 +0000 Subject: [PATCH] Fixed race condition test failure. The secondary thread, because it does nothing but a quick printf, was terminating before the test was able to check for its existence via IRunControl.getExecutionContexts(). Consequently, it would get one less thread than expected. --- .../data/launch/src/MultiThread.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThread.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThread.cc index 80f99fea6aa..6b8bfb0d6c6 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThread.cc +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/MultiThread.cc @@ -6,9 +6,9 @@ void *PrintHello(void *threadid) { - int tid; - tid = (int)threadid; + int tid = (int)threadid; printf("Hello World! It's me, thread #%d!\n", tid); + sleep(2); // keep this thread around for a bit; the tests will check for its existence while the main thread is stopped at a breakpoint pthread_exit(NULL); }