summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorKurt Miller <kurt@cvs.openbsd.org>2007-04-27 18:04:09 +0000
committerKurt Miller <kurt@cvs.openbsd.org>2007-04-27 18:04:09 +0000
commit3a581d5e76c368bf4de0ee9c6188aa3f951dd1ef (patch)
tree759439e6ca29f5c9503ba40febff3e6c6822100c /lib/libpthread
parent076107385debfd5627fbe3e03d316dd3dbc458ec (diff)
Remove unused function _thread_fd_unlock_owned() and
merge _thread_fd_unlock_thread() into _thread_fd_unlock(). okay marc@
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/pthread_private.h4
-rw-r--r--lib/libpthread/uthread/uthread_fd.c48
2 files changed, 5 insertions, 47 deletions
diff --git a/lib/libpthread/uthread/pthread_private.h b/lib/libpthread/uthread/pthread_private.h
index 1607525dfeb..15dedb454ca 100644
--- a/lib/libpthread/uthread/pthread_private.h
+++ b/lib/libpthread/uthread/pthread_private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pthread_private.h,v 1.61 2007/04/27 12:59:24 kurt Exp $ */
+/* $OpenBSD: pthread_private.h,v 1.62 2007/04/27 18:04:08 kurt Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -1160,8 +1160,6 @@ void _thread_fs_flags_replace(int, struct fs_flags *);
void _thread_fd_init(void);
int _thread_fd_table_init(int, enum fd_entry_mode, struct fs_flags *);
void _thread_fd_entry_close(int);
-void _thread_fd_unlock_owned(pthread_t);
-void _thread_fd_unlock_thread(struct pthread *, int, int);
pthread_addr_t _thread_gc(pthread_addr_t);
void _thread_enter_cancellation_point(void);
void _thread_leave_cancellation_point(void);
diff --git a/lib/libpthread/uthread/uthread_fd.c b/lib/libpthread/uthread/uthread_fd.c
index 632eadcc968..6b22bafd6ec 100644
--- a/lib/libpthread/uthread/uthread_fd.c
+++ b/lib/libpthread/uthread/uthread_fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_fd.c,v 1.28 2007/04/27 12:59:24 kurt Exp $ */
+/* $OpenBSD: uthread_fd.c,v 1.29 2007/04/27 18:04:08 kurt Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -488,11 +488,12 @@ _thread_fd_entry_close(int fd)
}
/*
- * Unlock the fd table entry for a given thread, fd, and lock type.
+ * Unlock an fd table entry for the given fd and lock type.
*/
void
-_thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type)
+_thread_fd_unlock(int fd, int lock_type)
{
+ struct pthread *thread = _get_curthread();
struct fd_table_entry *entry;
/*
@@ -600,47 +601,6 @@ _thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type)
}
/*
- * Unlock an fd table entry for the given fd and lock type.
- */
-void
-_thread_fd_unlock(int fd, int lock_type)
-{
- struct pthread *curthread = _get_curthread();
- _thread_fd_unlock_thread(curthread, fd, lock_type);
-}
-
-/*
- * Unlock all fd table entries owned by the given thread
- */
-void
-_thread_fd_unlock_owned(pthread_t pthread)
-{
- struct fd_table_entry *entry;
- int do_unlock;
- int fd;
-
- for (fd = 0; fd < _thread_max_fdtsize; fd++) {
- entry = _thread_fd_table[fd];
- if (entry) {
- _SPINLOCK(&entry->lock);
- do_unlock = 0;
- /* force an unlock regardless of the recursion level */
- if (entry->r_owner == pthread) {
- entry->r_lockcount = 1;
- do_unlock++;
- }
- if (entry->w_owner == pthread) {
- entry->w_lockcount = 1;
- do_unlock++;
- }
- _SPINUNLOCK(&entry->lock);
- if (do_unlock)
- _thread_fd_unlock_thread(pthread, fd, FD_RDWR);
- }
- }
-}
-
-/*
* Lock an fd table entry for the given fd and lock type.
*/
int