diff --git a/test/threads.cpp b/test/threads.cpp index 8d6ee151..c00d95a4 100644 --- a/test/threads.cpp +++ b/test/threads.cpp @@ -52,14 +52,8 @@ protected: { cancelled_ = true; - /* - * Cancel the thread and call a guaranteed cancellation point - * (nanosleep). - */ pthread_cancel(pthread_self()); - - struct timespec req{ 0, 100*000*000 }; - nanosleep(&req, nullptr); + pthread_testcancel(); cancelled_ = false; }