diff --git a/src/threads.h b/src/threads.h
index a3b7dec9095a889b963167daeea151144dcf2644..74c32c90033fc511661ab765d464c69e4ef0795b 100644
--- a/src/threads.h
+++ b/src/threads.h
@@ -255,7 +255,7 @@ struct thread_state {
 #endif
 
 #ifndef th_equal
-#define th_equal(X,Y) (!MEMCPY(&(X),&(Y),sizeof(THREAD_T)))
+#define th_equal(X,Y) (!MEMCMP(&(X),&(Y),sizeof(THREAD_T)))
 #endif
 
 #ifndef th_hash