]> Savannah Git Hosting - gnulib.git/commitdiff
pthread_sigmask tests: Use new multithread modules.
authorBruno Haible <bruno@clisp.org>
Mon, 15 Jul 2019 00:41:24 +0000 (02:41 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 15 Jul 2019 00:41:24 +0000 (02:41 +0200)
* tests/test-pthread_sigmask2.c: Include <pthread.h> instead of
glthread/thread.h.
(main_thread, killer_thread): Change type to pthread_t.
(main): Update accordingly.
* modules/pthread_sigmask-tests (Depends-on): Add pthread-thread. Remove
thread.

ChangeLog
modules/pthread_sigmask-tests
tests/test-pthread_sigmask2.c

index d9616366f5894c3f4820c6e43a2ee104599f6f12..81c92290425b24ccc3e3e970afddc2b798c46795 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2019-07-14  Bruno Haible  <bruno@clisp.org>
+
+       pthread_sigmask tests: Use new multithread modules.
+       * tests/test-pthread_sigmask2.c: Include <pthread.h> instead of
+       glthread/thread.h.
+       (main_thread, killer_thread): Change type to pthread_t.
+       (main): Update accordingly.
+       * modules/pthread_sigmask-tests (Depends-on): Add pthread-thread. Remove
+       thread.
+
 2019-07-14  Bruno Haible  <bruno@clisp.org>
 
        pthread-tss: Add tests.
index 23fc1556c93be52324508e16918eb4e3598bd8e5..e30bb9141155328e5400d93dab8eba3252fd4bf6 100644 (file)
@@ -6,7 +6,7 @@ tests/macros.h
 
 Depends-on:
 sleep
-thread
+pthread-thread
 
 configure.ac:
 
index e02c31235bbe868a59f5b9de068fdc4cc44470f1..0e5d4dda0fd771c691156f599c86251fec5c6c5c 100644 (file)
 #include <signal.h>
 
 #include <errno.h>
+#include <pthread.h>
 #include <stdio.h>
 #include <unistd.h>
 
-#include "glthread/thread.h"
-
 #include "macros.h"
 
 #if USE_POSIX_THREADS
 
-static gl_thread_t main_thread;
-static gl_thread_t killer_thread;
+static pthread_t main_thread;
+static pthread_t killer_thread;
 
 static void *
 killer_thread_func (void *arg)
@@ -66,8 +65,8 @@ main (int argc, char *argv[])
   ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0);
 
   /* Request a SIGINT signal from another thread.  */
-  main_thread = gl_thread_self ();
-  ASSERT (glthread_create (&killer_thread, killer_thread_func, NULL) == 0);
+  main_thread = pthread_self ();
+  ASSERT (pthread_create (&killer_thread, NULL, killer_thread_func, NULL) == 0);
 
   /* Wait.  */
   sleep (2);
@@ -86,7 +85,7 @@ main (int argc, char *argv[])
 
   /* Clean up the thread.  This avoid a "ThreadSanitizer: thread leak" warning
      from "gcc -fsanitize=thread".  */
-  gl_thread_join (killer_thread, NULL);
+  ASSERT (pthread_join (killer_thread, NULL) == 0);
 
   return 0;
 }