diff --git a/test/threads.cpp b/test/threads.cpp
index 8d6ee1510..c00d95a41 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;
 	}
