summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-02-11 22:07:32 +0000
committerdeischen <deischen@FreeBSD.org>2001-02-11 22:07:32 +0000
commit3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f (patch)
tree5a22dcd523f742073beada495d06ed1dc2fce5e9 /lib/libpthread
parent1143b5e42a7816a7665798bcab7d5db4a37935b3 (diff)
downloadFreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.zip
FreeBSD-src-3de2e69a0dc1cf1cb405a6267a7fefed942b7d1f.tar.gz
Remove (int) file descriptor locking. It should be up to the
application to provide locking for I/O operations. This doesn't break any of my tests, but the old behavior can be restored by compiling with _FDLOCKS_ENABLED. This will eventually be removed when it is obvious it does not cause any problems. Remove most of flockfile implementation, with the exception of flockfile_debug. Make error messages more informational (submitted by Mike Heffner <spock@techfour.net>, who's now known as mikeh@FreeBSD.org).
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_exit.c13
-rw-r--r--lib/libpthread/thread/thr_private.h3
-rw-r--r--lib/libpthread/thread/thr_sig.c5
3 files changed, 4 insertions, 17 deletions
diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c
index 169aa4f..fd0e84a 100644
--- a/lib/libpthread/thread/thr_exit.c
+++ b/lib/libpthread/thread/thr_exit.c
@@ -87,13 +87,9 @@ _thread_exit(char *fname, int lineno, char *string)
char s[256];
/* Prepare an error message string: */
- strcpy(s, "Fatal error '");
- strcat(s, string);
- strcat(s, "' at line ? ");
- strcat(s, "in file ");
- strcat(s, fname);
- strcat(s, " (errno = ?");
- strcat(s, ")\n");
+ snprintf(s, sizeof(s),
+ "Fatal error '%s' at line %d in file %s (errno = %d)\n",
+ string, lineno, fname, errno);
/* Write the string to the standard error file descriptor: */
__sys_write(2, s, strlen(s));
@@ -127,9 +123,6 @@ _thread_exit_cleanup(void)
/* Unlock all owned fd locks: */
_thread_fd_unlock_owned(curthread);
- /* Unlock all owned file locks: */
- _funlock_owned(curthread);
-
/* Unlock all private mutexes: */
_mutex_unlock_private(curthread);
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h
index 78b75ef..7a37de8 100644
--- a/lib/libpthread/thread/thr_private.h
+++ b/lib/libpthread/thread/thr_private.h
@@ -1208,8 +1208,6 @@ void _cond_wait_backout(pthread_t);
void _fd_lock_backout(pthread_t);
int _find_dead_thread(pthread_t);
int _find_thread(pthread_t);
-void _flockfile_backout(pthread_t);
-void _funlock_owned(pthread_t);
struct pthread *_get_curthread(void);
void _set_curthread(struct pthread *);
void _join_backout(pthread_t);
@@ -1241,6 +1239,7 @@ int _pthread_mutexattr_init(pthread_mutexattr_t *);
int _pthread_mutexattr_destroy(pthread_mutexattr_t *);
int _pthread_mutexattr_settype(pthread_mutexattr_t *, int);
int _pthread_once(pthread_once_t *, void (*) (void));
+pthread_t _pthread_self(void);
int _pthread_setspecific(pthread_key_t, const void *);
void _waitq_insert(pthread_t pthread);
void _waitq_remove(pthread_t pthread);
diff --git a/lib/libpthread/thread/thr_sig.c b/lib/libpthread/thread/thr_sig.c
index 9559bb7..a005adf 100644
--- a/lib/libpthread/thread/thr_sig.c
+++ b/lib/libpthread/thread/thr_sig.c
@@ -941,11 +941,6 @@ _thread_sig_wrapper(void)
psf->saved_state.psd_state = PS_RUNNING;
break;
- case PS_FILE_WAIT:
- _flockfile_backout(thread);
- psf->saved_state.psd_state = PS_RUNNING;
- break;
-
case PS_COND_WAIT:
_cond_wait_backout(thread);
psf->saved_state.psd_state = PS_RUNNING;
OpenPOWER on IntegriCloud