-static spinlock_t thread_lock = _SPINLOCK_INITIALIZER;
-#define THREAD_LOCK() if (__isthreaded) _SPINLOCK(&thread_lock)
-#define THREAD_UNLOCK() if (__isthreaded) _SPINUNLOCK(&thread_lock)
-
-#if NOT_YET
-#define SET_GLUE_PTR(ptr, val) atomic_set_rel_ptr(&(ptr), (uintptr_t)(val))
-#else
-#define SET_GLUE_PTR(ptr, val) ptr = val
-#endif
+static pthread_mutex_t filelist_lock = PTHREAD_MUTEX_INITIALIZER;
+#define FILELIST_LOCK() do { pthread_mutex_lock(&filelist_lock); } while(0)
+#define FILELIST_UNLOCK() do { pthread_mutex_unlock(&filelist_lock); } while(0)