From 3fb68ba7fd6da634fdd198bc362957640956a007 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 30 Nov 2000 10:16:31 +0000 Subject: * coop.c: Remove old non-working code. Thanks to Julian Satchell. * threads.c: Added comments. --- libguile/ChangeLog | 7 +++++++ libguile/coop.c | 11 +---------- libguile/threads.c | 11 ++++++++++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8801b50e6..0dd200d2a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2000-11-30 Dirk Herrmann + + * coop.c (coop_aborthelp, coop_join): When a thread finishes, its + stack base is not set to NULL any more. + + * threads.c (scm_thread_join): Added FIXME comment. + 2000-06-08 Dirk Herrmann * coop.c (scm_I_am_dead): Made static and renamed to I_am_dead. diff --git a/libguile/coop.c b/libguile/coop.c index 8182e2565..7fcd30bfa 100644 --- a/libguile/coop.c +++ b/libguile/coop.c @@ -40,7 +40,7 @@ * If you do not wish that, delete this exception notice. */ -/* $Id: coop.c,v 1.25.2.2 2000-06-08 14:26:09 dirk Exp $ */ +/* $Id: coop.c,v 1.25.2.3 2000-11-30 10:16:31 dirk Exp $ */ /* Cooperative thread library, based on QuickThreads */ @@ -721,11 +721,6 @@ coop_aborthelp (qt_t *sp, void *old, void *null) { coop_t *oldthread = (coop_t *) old; -#if 0 - /* Marking old->base NULL indicates that this thread is dead */ - oldthread->base = NULL; -#endif - if (oldthread->specific) free (oldthread->specific); #ifndef GUILE_PTHREAD_COMPAT @@ -744,10 +739,6 @@ coop_join(coop_t *t) { coop_t *old, *newthread; - /* Check if t is already finished */ - if (t->base == NULL) - return; - /* Create a join list if necessary */ if (t->joining == NULL) { diff --git a/libguile/threads.c b/libguile/threads.c index 34f9cc23d..279adeca1 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -387,6 +387,15 @@ SCM_DEFINE(scm_thread_join, "thread-join", 1, 0, 0, { scm_thread_t thread_data; SCM_VALIDATE_THREAD (1, thread); + /* Dirk:FIXME:: SCM_THREAD_DATA is a handle for a thread. It may be that a + * certain thread implementation uses a value of 0 as a valid thread handle. + * With the following code, this thread would always be considered finished. + */ + /* Dirk:FIXME:: With preemptive threading, a thread may finish immediately + * after SCM_THREAD_DATA is read. Thus, it must be guaranteed that the + * handle remains valid until the thread-object is garbage collected, or + * a mutex has to be used for reading and modifying SCM_THREAD_DATA. + */ thread_data = SCM_THREAD_DATA (thread); if (thread_data) /* The thread is still alive */ -- cgit v1.2.1