Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: gdb/testsuite/gdb.threads/fork-thread-pending.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.threads/fork-child-threads.exp ('k') | gdb/testsuite/gdb.threads/fork-thread-pending.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.threads/fork-thread-pending.c
diff --git a/gdb/testsuite/gdb.threads/fork-thread-pending.c b/gdb/testsuite/gdb.threads/fork-thread-pending.c
index ba8824ec85ffb8d46be77369c5537d7f2ed8498e..82317d4b37544ac859e2094b60fba4d1a58f090c 100644
--- a/gdb/testsuite/gdb.threads/fork-thread-pending.c
+++ b/gdb/testsuite/gdb.threads/fork-thread-pending.c
@@ -28,6 +28,7 @@
#define NUMTHREADS 10
volatile int done = 0;
+static pthread_barrier_t barrier;
static void *
start (void *arg)
@@ -45,6 +46,8 @@ thread_function (void *arg)
printf ("Thread <%d> executing\n", x);
+ pthread_barrier_wait (&barrier);
+
while (!done)
usleep (100);
@@ -62,6 +65,8 @@ thread_forker (void *arg)
printf ("Thread forker <%d> executing\n", x);
+ pthread_barrier_wait (&barrier);
+
switch ((pid = fork ()))
{
case -1:
@@ -89,6 +94,9 @@ main (void)
int args[NUMTHREADS];
int i, j;
+ i = pthread_barrier_init (&barrier, NULL, NUMTHREADS);
+ assert (i == 0);
+
/* Create a few threads that do mostly nothing, and then one that
forks. */
for (j = 0; j < NUMTHREADS - 1; ++j)
« no previous file with comments | « gdb/testsuite/gdb.threads/fork-child-threads.exp ('k') | gdb/testsuite/gdb.threads/fork-thread-pending.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698