summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>1999-05-07 07:59:44 +0000
committerjasone <jasone@FreeBSD.org>1999-05-07 07:59:44 +0000
commit1780bb280607e3079dbe68566ad6bf049aff602e (patch)
treeb6d8e1ebe8181a4bf120a1702d067b022ec4b629 /lib
parent0d0773d84f295dd59e9afc676ff3cd92a1414927 (diff)
downloadFreeBSD-src-1780bb280607e3079dbe68566ad6bf049aff602e.zip
FreeBSD-src-1780bb280607e3079dbe68566ad6bf049aff602e.tar.gz
Apply patch included in bin/8872. This fixes a bug that occurs when
pthread_cond_timedwait() times out. PR: bin/8872 Submitted by: Jason Evans <jasone@canonware.com> Reviewed by: David Schwartz <davids@webmaster.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/uthread/uthread_kern.c13
-rw-r--r--lib/libkse/thread/thr_kern.c13
-rw-r--r--lib/libpthread/thread/thr_kern.c13
3 files changed, 33 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c
index 626f1d4..7c4dffa 100644
--- a/lib/libc_r/uthread/uthread_kern.c
+++ b/lib/libc_r/uthread/uthread_kern.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_kern.c,v 1.14 1998/10/09 19:01:30 dt Exp $
+ * $Id: uthread_kern.c,v 1.16 1999/03/23 05:07:56 jb Exp $
*
*/
#include <errno.h>
@@ -212,7 +212,16 @@ __asm__("fnsave %0": :"m"(*fdata));
FD_ZERO(&pthread->data.select_data->writefds);
FD_ZERO(&pthread->data.select_data->exceptfds);
pthread->data.select_data->nfds = 0;
- }
+ } else if (pthread->state == PS_COND_WAIT) {
+ /*
+ * The pthread_cond_timedwait()
+ * has timed out, so remove the
+ * thread from the condition's
+ * queue.
+ */
+ _thread_queue_remove(pthread->queue,
+ pthread);
+ }
/*
* Return an error as an interrupted
* wait:
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c
index 626f1d4..7c4dffa 100644
--- a/lib/libkse/thread/thr_kern.c
+++ b/lib/libkse/thread/thr_kern.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_kern.c,v 1.14 1998/10/09 19:01:30 dt Exp $
+ * $Id: uthread_kern.c,v 1.16 1999/03/23 05:07:56 jb Exp $
*
*/
#include <errno.h>
@@ -212,7 +212,16 @@ __asm__("fnsave %0": :"m"(*fdata));
FD_ZERO(&pthread->data.select_data->writefds);
FD_ZERO(&pthread->data.select_data->exceptfds);
pthread->data.select_data->nfds = 0;
- }
+ } else if (pthread->state == PS_COND_WAIT) {
+ /*
+ * The pthread_cond_timedwait()
+ * has timed out, so remove the
+ * thread from the condition's
+ * queue.
+ */
+ _thread_queue_remove(pthread->queue,
+ pthread);
+ }
/*
* Return an error as an interrupted
* wait:
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c
index 626f1d4..7c4dffa 100644
--- a/lib/libpthread/thread/thr_kern.c
+++ b/lib/libpthread/thread/thr_kern.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: uthread_kern.c,v 1.14 1998/10/09 19:01:30 dt Exp $
+ * $Id: uthread_kern.c,v 1.16 1999/03/23 05:07:56 jb Exp $
*
*/
#include <errno.h>
@@ -212,7 +212,16 @@ __asm__("fnsave %0": :"m"(*fdata));
FD_ZERO(&pthread->data.select_data->writefds);
FD_ZERO(&pthread->data.select_data->exceptfds);
pthread->data.select_data->nfds = 0;
- }
+ } else if (pthread->state == PS_COND_WAIT) {
+ /*
+ * The pthread_cond_timedwait()
+ * has timed out, so remove the
+ * thread from the condition's
+ * queue.
+ */
+ _thread_queue_remove(pthread->queue,
+ pthread);
+ }
/*
* Return an error as an interrupted
* wait:
OpenPOWER on IntegriCloud