Upstream atexit

Change-Id: Ia454a2181b5058ed9783dc02b6b1805d0e4d2715
diff --git a/libc/private/thread_private.h b/libc/private/thread_private.h
index 724808a..b8b1a81 100644
--- a/libc/private/thread_private.h
+++ b/libc/private/thread_private.h
@@ -33,8 +33,12 @@
 #define _THREAD_PRIVATE_MUTEX_UNLOCK(name) \
 	pthread_mutex_unlock( &__THREAD_NAME(name)._private_lock )
 
-__LIBC_HIDDEN__ void	_thread_atexit_lock(void);
-__LIBC_HIDDEN__ void	_thread_atexit_unlock(void);
+/* Note that these aren't compatible with the usual OpenBSD ones which lazy-initialize! */
+#define _MUTEX_LOCK(l) pthread_mutex_lock((pthread_mutex_t*) l)
+#define _MUTEX_UNLOCK(l) pthread_mutex_unlock((pthread_mutex_t*) l)
+
+__LIBC_HIDDEN__ void  _thread_atexit_lock(void);
+__LIBC_HIDDEN__ void  _thread_atexit_unlock(void);
 
 #define _ATEXIT_LOCK() _thread_atexit_lock()
 #define _ATEXIT_UNLOCK() _thread_atexit_unlock()