summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/dirstream.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2006-12-07 23:24:02 +0000
committerEric Andersen <andersen@codepoet.org>2006-12-07 23:24:02 +0000
commit1478c2de052374c6356db5513749a144c13791b1 (patch)
tree3b22a3f8361f94c99508c497e240ecb71acf8641 /libc/misc/dirent/dirstream.h
parent99d6c367c4820a072dc4ada51561df17e2093778 (diff)
Major cleanup of internal mutex locking. Be more consistant in how we do
things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking.
Diffstat (limited to 'libc/misc/dirent/dirstream.h')
-rw-r--r--libc/misc/dirent/dirstream.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/libc/misc/dirent/dirstream.h b/libc/misc/dirent/dirstream.h
index a90ca6312..761111b9e 100644
--- a/libc/misc/dirent/dirstream.h
+++ b/libc/misc/dirent/dirstream.h
@@ -26,9 +26,8 @@ Cambridge, MA 02139, USA. */
#include <features.h>
#include <sys/types.h>
-#ifdef __UCLIBC_HAS_THREADS__
-#include <pthread.h>
-#endif
+
+#include <bits/uClibc_mutex.h>
/* For now, syscall readdir () only supports one entry at a time. It
* will be changed in the future.
@@ -63,11 +62,7 @@ struct __dirstream {
size_t dd_max;
/* lock */
-#ifdef __UCLIBC_HAS_THREADS__
- pthread_mutex_t dd_lock;
-#else
- void *dd_lock;
-#endif
+ __UCLIBC_MUTEX(dd_lock);
}; /* stream data from opendir() */