Eliminate PS_FILE_WAIT state, instead use FILE locking code in libc.
authorDavid Xu <davidxu@dragonflybsd.org>
Mon, 9 May 2005 13:28:40 +0000 (13:28 +0000)
committerDavid Xu <davidxu@dragonflybsd.org>
Mon, 9 May 2005 13:28:40 +0000 (13:28 +0000)
lib/libc_r/uthread/Makefile.inc
lib/libc_r/uthread/pthread_private.h
lib/libc_r/uthread/uthread_cancel.c
lib/libc_r/uthread/uthread_exit.c
lib/libc_r/uthread/uthread_info.c
lib/libc_r/uthread/uthread_kern.c
lib/libc_r/uthread/uthread_sig.c

index 2fbc129..29360cc 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/lib/libc_r/uthread/Makefile.inc,v 1.23.2.8 2003/05/27 18:18:01 jdp Exp $
-# $DragonFly: src/lib/libc_r/uthread/Makefile.inc,v 1.6 2005/05/03 07:29:04 joerg Exp $
+# $DragonFly: src/lib/libc_r/uthread/Makefile.inc,v 1.7 2005/05/09 13:28:40 davidxu Exp $
 
 # uthread sources
 .PATH: ${.CURDIR}/uthread
@@ -50,7 +50,6 @@ SRCS+= \
        uthread_fchown.c \
        uthread_fcntl.c \
        uthread_fd.c \
-       uthread_file.c \
        uthread_find_thread.c \
        uthread_flock.c \
        uthread_fork.c \
index 2794fa1..54d9c86 100644 (file)
@@ -32,7 +32,7 @@
  * Private thread definitions for the uthread kernel.
  *
  * $FreeBSD: src/lib/libc_r/uthread/pthread_private.h,v 1.36.2.21 2002/10/22 14:44:02 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/pthread_private.h,v 1.8 2005/05/03 07:29:04 joerg Exp $
+ * $DragonFly: src/lib/libc_r/uthread/pthread_private.h,v 1.9 2005/05/09 13:28:40 davidxu Exp $
  */
 
 #ifndef _PTHREAD_PRIVATE_H
@@ -484,7 +484,6 @@ enum pthread_state {
        PS_FDLW_WAIT,
        PS_FDR_WAIT,
        PS_FDW_WAIT,
-       PS_FILE_WAIT,
        PS_POLL_WAIT,
        PS_SELECT_WAIT,
        PS_SLEEP_WAIT,
index f9e55a4..0fea4c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * David Leonard <d@openbsd.org>, 1999. Public domain.
  * $FreeBSD: src/lib/libc_r/uthread/uthread_cancel.c,v 1.3.2.9 2002/10/22 14:44:02 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_cancel.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
+ * $DragonFly: src/lib/libc_r/uthread/uthread_cancel.c,v 1.3 2005/05/09 13:28:40 davidxu Exp $
  */
 #include <sys/errno.h>
 #include <pthread.h>
@@ -83,7 +83,6 @@ _pthread_cancel(pthread_t pthread)
                        case PS_COND_WAIT:
                        case PS_FDLR_WAIT:
                        case PS_FDLW_WAIT:
-                       case PS_FILE_WAIT:
                                /*
                                 * Threads in these states may be in queues.
                                 * In order to preserve queue integrity, the
index f5e8a84..9a8d2fd 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_exit.c,v 1.16.2.8 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_exit.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
+ * $DragonFly: src/lib/libc_r/uthread/uthread_exit.c,v 1.3 2005/05/09 13:28:40 davidxu Exp $
  */
 #include <errno.h>
 #include <unistd.h>
@@ -130,9 +130,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);
 
index a8baefc..c2ae69e 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_info.c,v 1.14.2.9 2003/02/15 05:35:31 kris Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_info.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
+ * $DragonFly: src/lib/libc_r/uthread/uthread_info.c,v 1.3 2005/05/09 13:28:40 davidxu Exp $
  */
 #include <errno.h>
 #include <fcntl.h>
@@ -65,7 +65,6 @@ static const struct s_thread_info thread_info[] = {
        {PS_FDLW_WAIT   , "Waiting for a file write lock"},
        {PS_FDR_WAIT    , "Waiting for read"},
        {PS_FDW_WAIT    , "Waiting for write"},
-       {PS_FILE_WAIT   , "Waiting for FILE lock"},
        {PS_POLL_WAIT   , "Waiting on poll"},
        {PS_SELECT_WAIT , "Waiting on select"},
        {PS_SLEEP_WAIT  , "Sleeping"},
index 770e9ef..a15b8e8 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_kern.c,v 1.28.2.13 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_kern.c,v 1.3 2005/04/28 18:16:47 joerg Exp $
+ * $DragonFly: src/lib/libc_r/uthread/uthread_kern.c,v 1.4 2005/05/09 13:28:40 davidxu Exp $
  *
  */
 #include <errno.h>
@@ -281,7 +281,6 @@ _thread_kern_scheduler(void)
                        case PS_DEADLOCK:
                        case PS_FDLR_WAIT:
                        case PS_FDLW_WAIT:
-                       case PS_FILE_WAIT:
                        case PS_JOIN:
                        case PS_MUTEX_WAIT:
                        case PS_SIGSUSPEND:
index e460841..77b03d8 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libc_r/uthread/uthread_sig.c,v 1.25.2.13 2002/10/22 14:44:03 fjoe Exp $
- * $DragonFly: src/lib/libc_r/uthread/uthread_sig.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
+ * $DragonFly: src/lib/libc_r/uthread/uthread_sig.c,v 1.3 2005/05/09 13:28:40 davidxu Exp $
  */
 #include <sys/param.h>
 #include <sys/types.h>
@@ -727,7 +727,6 @@ thread_sig_add(struct pthread *pthread, int sig, int has_args)
         */
        case PS_FDLR_WAIT:
        case PS_FDLW_WAIT:
-       case PS_FILE_WAIT:
                if (restart == 0)
                        pthread->interrupted = 1;
                /*
@@ -879,7 +878,6 @@ thread_sig_check_state(struct pthread *pthread, int sig)
         */
        case PS_FDR_WAIT:
        case PS_FDW_WAIT:
-       case PS_FILE_WAIT:
        case PS_POLL_WAIT:
        case PS_SELECT_WAIT:
                /*
@@ -989,11 +987,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;