From 768c8cdce4390df345d6498b2a3307d67a5749e7 Mon Sep 17 00:00:00 2001 From: Marco S Hyman Date: Mon, 7 Jun 2004 21:11:24 +0000 Subject: major bump to libc and libpthread to break the dependency of a particular implementation of libpthread for libc. libc no longer needs pthread.h to compile. OK millert@, brad@, tedu@ --- lib/libpthread/uthread/pthread_private.h | 4 +-- lib/libpthread/uthread/uthread_fd.c | 43 ++++++++------------------------ lib/libpthread/uthread/uthread_file.c | 13 +++------- lib/libpthread/uthread/uthread_init.c | 9 +++---- 4 files changed, 19 insertions(+), 50 deletions(-) (limited to 'lib/libpthread/uthread') diff --git a/lib/libpthread/uthread/pthread_private.h b/lib/libpthread/uthread/pthread_private.h index afafee5e642..aef55382c95 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.52 2004/02/01 06:22:14 brad Exp $ */ +/* $OpenBSD: pthread_private.h,v 1.53 2004/06/07 21:11:23 marc Exp $ */ /* * Copyright (c) 1995-1998 John Birrell . * All rights reserved. @@ -1117,7 +1117,7 @@ int _thread_fd_table_init(int); int _thread_fd_table_dup(int, int); void _thread_fd_table_remove(int); void _thread_fd_unlock_owned(pthread_t); -void _thread_fd_unlock_thread(struct pthread *, int, int, const char *, int); +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 ac81f56e1f1..a32a09c07e9 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.21 2003/02/14 03:58:42 marc Exp $ */ +/* $OpenBSD: uthread_fd.c,v 1.22 2004/06/07 21:11:23 marc Exp $ */ /* * Copyright (c) 1995-1998 John Birrell * All rights reserved. @@ -275,8 +275,7 @@ _thread_fd_table_remove(int fd) * Unlock the fd table entry for a given thread, fd, and lock type. */ void -_thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type, - const char *fname, int lineno) +_thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type) { struct fd_table_entry *entry; int ret; @@ -300,10 +299,7 @@ _thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type, * other threads for clashing with the current * thread's accesses: */ - if (fname) - _spinlock_debug(&entry->lock, (char *)fname, lineno); - else - _SPINLOCK(&entry->lock); + _SPINLOCK(&entry->lock); /* Check if the running thread owns the read lock: */ if (entry->r_owner == thread && @@ -393,14 +389,13 @@ _thread_fd_unlock_thread(struct pthread *thread, int fd, int lock_type, } /* - * Unlock an fd table entry for the given fd and lock type. Save - * fname and lineno (debug variables). + * Unlock an fd table entry for the given fd and lock type. */ void -_thread_fd_unlock(int fd, int lock_type, const char *fname, int lineno) +_thread_fd_unlock(int fd, int lock_type) { struct pthread *curthread = _get_curthread(); - _thread_fd_unlock_thread(curthread, fd, lock_type, fname, lineno); + _thread_fd_unlock_thread(curthread, fd, lock_type); } /* @@ -429,20 +424,16 @@ _thread_fd_unlock_owned(pthread_t pthread) } _SPINUNLOCK(&entry->lock); if (do_unlock) - _thread_fd_unlock_thread(pthread, fd, FD_RDWR, - __FILE__, __LINE__); + _thread_fd_unlock_thread(pthread, fd, FD_RDWR); } } } /* - * Lock an fd table entry for the given fd and lock type. Save - * fname and lineno (debug variables). The debug variables may be - * null when called by the non-debug version of the function. + * Lock an fd table entry for the given fd and lock type. */ int -_thread_fd_lock(int fd, int lock_type, struct timespec * timeout, - const char *fname, int lineno) +_thread_fd_lock(int fd, int lock_type, struct timespec * timeout) { struct pthread *curthread = _get_curthread(); struct fd_table_entry *entry; @@ -461,11 +452,7 @@ _thread_fd_lock(int fd, int lock_type, struct timespec * timeout, * other threads for clashing with the current * thread's accesses: */ - if (fname) - _spinlock_debug(&entry->lock, (char *)fname, lineno); - else - _SPINLOCK(&entry->lock); - + _SPINLOCK(&entry->lock); /* Handle read locks */ if (lock_type == FD_READ || lock_type == FD_RDWR) { /* @@ -493,9 +480,6 @@ _thread_fd_lock(int fd, int lock_type, struct timespec * timeout, * running thread: */ curthread->data.fd.fd = fd; - curthread->data.fd.branch = lineno; - curthread->data.fd.fname = - (char *)fname; /* Set the timeout: */ _thread_kern_set_timeout(timeout); @@ -536,8 +520,6 @@ _thread_fd_lock(int fd, int lock_type, struct timespec * timeout, * this file descriptor: */ entry->r_lockcount = 0; - entry->r_fname = fname; - entry->r_lineno = lineno; } } @@ -573,9 +555,6 @@ _thread_fd_lock(int fd, int lock_type, struct timespec * timeout, * running thread: */ curthread->data.fd.fd = fd; - curthread->data.fd.branch = lineno; - curthread->data.fd.fname = - (char *)fname; /* Set the timeout: */ _thread_kern_set_timeout(timeout); @@ -615,8 +594,6 @@ _thread_fd_lock(int fd, int lock_type, struct timespec * timeout, * for this file descriptor: */ entry->w_lockcount = 0; - entry->w_fname = fname; - entry->w_lineno = lineno; } } diff --git a/lib/libpthread/uthread/uthread_file.c b/lib/libpthread/uthread/uthread_file.c index b50174c0d2b..71c0ffc35aa 100644 --- a/lib/libpthread/uthread/uthread_file.c +++ b/lib/libpthread/uthread/uthread_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_file.c,v 1.10 2003/01/31 04:46:17 marc Exp $ */ +/* $OpenBSD: uthread_file.c,v 1.11 2004/06/07 21:11:23 marc Exp $ */ /* * Copyright (c) 1995 John Birrell . * All rights reserved. @@ -173,7 +173,7 @@ do_lock(int idx, FILE *fp) } void -_flockfile_debug(FILE * fp, char *fname, int lineno) +flockfile(FILE * fp) { int idx = file_idx(fp); struct file_lock *p; @@ -230,19 +230,12 @@ _flockfile_debug(FILE * fp, char *fname, int lineno) _SPINUNLOCK(&hash_lock); /* Wait on the FILE lock: */ - _thread_kern_sched_state(PS_FILE_WAIT, fname, lineno); + _thread_kern_sched_state(PS_FILE_WAIT, "", 0); } } return; } -void -flockfile(FILE * fp) -{ - _flockfile_debug(fp, (char *) "?", 1); - return; -} - int ftrylockfile(FILE * fp) { diff --git a/lib/libpthread/uthread/uthread_init.c b/lib/libpthread/uthread/uthread_init.c index 6a1833039e2..531753880e6 100644 --- a/lib/libpthread/uthread/uthread_init.c +++ b/lib/libpthread/uthread/uthread_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_init.c,v 1.31 2004/01/15 22:22:12 marc Exp $ */ +/* $OpenBSD: uthread_init.c,v 1.32 2004/06/07 21:11:23 marc Exp $ */ /* * Copyright (c) 1995-1998 John Birrell * All rights reserved. @@ -134,11 +134,10 @@ static void *references[] = { &_thread_malloc_init, &_thread_malloc_lock, &_thread_malloc_unlock, - &_libc_private_storage, - &_libc_private_storage_lock, - &_libc_private_storage_unlock, + &_thread_tag_lock, + &_thread_tag_unlock, + &_thread_tag_storage, &flockfile, - &_flockfile_debug, &ftrylockfile, &funlockfile }; -- cgit v1.2.3