From 02c6730924b4c5a0508b785bad1b1e51cb09ed04 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 15 Jul 2019 02:41:24 +0200 Subject: [PATCH] pthread_sigmask tests: Use new multithread modules. * tests/test-pthread_sigmask2.c: Include 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 | 10 ++++++++++ modules/pthread_sigmask-tests | 2 +- tests/test-pthread_sigmask2.c | 13 ++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9616366f5..81c9229042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2019-07-14 Bruno Haible + + pthread_sigmask tests: Use new multithread modules. + * tests/test-pthread_sigmask2.c: Include 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 pthread-tss: Add tests. diff --git a/modules/pthread_sigmask-tests b/modules/pthread_sigmask-tests index 23fc1556c9..e30bb91411 100644 --- a/modules/pthread_sigmask-tests +++ b/modules/pthread_sigmask-tests @@ -6,7 +6,7 @@ tests/macros.h Depends-on: sleep -thread +pthread-thread configure.ac: diff --git a/tests/test-pthread_sigmask2.c b/tests/test-pthread_sigmask2.c index e02c31235b..0e5d4dda0f 100644 --- a/tests/test-pthread_sigmask2.c +++ b/tests/test-pthread_sigmask2.c @@ -21,17 +21,16 @@ #include #include +#include #include #include -#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; } -- 2.39.5