* gdb.mi/mi-nonstop.exp: Fix the check for non-stop
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / non-stop.c
index 9b006ebf576dbb6e24078cc7fe690436575041f4..83acc8223b7b009adb7548f7d2b4fdd7d109baee 100644 (file)
@@ -42,7 +42,7 @@ void break_at_me (int id, int i)
 void *
 worker (void *arg)
 {
-  int id = (int)arg;
+  int id = *(int *)arg;
   int i = 0;
   
   /* When gdb is running, it sets hidden breakpoints in the thread
@@ -66,8 +66,11 @@ pthread_t
 create_thread (int id)
 {
   pthread_t tid;
+  /* This memory will be leaked, we don't care for a test.  */
+  int *id2 = malloc (sizeof (int));
+  *id2 = id;
 
-  if (pthread_create (&tid, PTHREAD_CREATE_NULL_ARG2, worker, (void *) id))
+  if (pthread_create (&tid, PTHREAD_CREATE_NULL_ARG2, worker, (void *) id2))
     {
       perror ("pthread_create 1");
       exit (1);
This page took 0.024924 seconds and 4 git commands to generate.