mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 17:00:23 +02:00
* coop.c (coop_create): Set specific' field, not
data' to NULL.
This commit is contained in:
parent
941132492e
commit
ac1aca3515
1 changed files with 11 additions and 8 deletions
|
@ -40,7 +40,7 @@
|
||||||
* If you do not wish that, delete this exception notice. */
|
* If you do not wish that, delete this exception notice. */
|
||||||
|
|
||||||
|
|
||||||
/* $Id: coop.c,v 1.20 2000-03-29 01:57:40 mdj Exp $ */
|
/* $Id: coop.c,v 1.21 2000-03-29 10:43:18 mdj Exp $ */
|
||||||
|
|
||||||
/* Cooperative thread library, based on QuickThreads */
|
/* Cooperative thread library, based on QuickThreads */
|
||||||
|
|
||||||
|
@ -542,9 +542,9 @@ coop_condition_variable_destroy (coop_c *c)
|
||||||
|
|
||||||
/* 1K room for the cond wait routine */
|
/* 1K room for the cond wait routine */
|
||||||
#ifdef SCM_STACK_GROWS_UP
|
#ifdef SCM_STACK_GROWS_UP
|
||||||
#define COOP_STACK_ROOM (512)
|
#define COOP_STACK_ROOM (256)
|
||||||
#else
|
#else
|
||||||
#define COOP_STACK_ROOM (-512)
|
#define COOP_STACK_ROOM (-256)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -570,13 +570,17 @@ coop_create (coop_userf_t *f, void *pu)
|
||||||
#ifdef GUILE_PTHREAD_COMPAT
|
#ifdef GUILE_PTHREAD_COMPAT
|
||||||
t = coop_qget (&coop_deadq);
|
t = coop_qget (&coop_deadq);
|
||||||
if (t)
|
if (t)
|
||||||
t->sp = t->base;
|
{
|
||||||
|
t->sp = t->base;
|
||||||
|
t->specific = 0;
|
||||||
|
t->n_keys = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
t = malloc (sizeof (coop_t));
|
t = malloc (sizeof (coop_t));
|
||||||
|
|
||||||
t->data = NULL;
|
t->specific = NULL;
|
||||||
t->n_keys = 0;
|
t->n_keys = 0;
|
||||||
#ifdef GUILE_PTHREAD_COMPAT
|
#ifdef GUILE_PTHREAD_COMPAT
|
||||||
pthread_cond_init (&t->dummy_cond, NULL);
|
pthread_cond_init (&t->dummy_cond, NULL);
|
||||||
|
@ -653,13 +657,12 @@ coop_aborthelp (qt_t *sp, void *old, void *null)
|
||||||
oldthread->base = NULL;
|
oldthread->base = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (oldthread->data)
|
if (oldthread->specific)
|
||||||
free (oldthread->data);
|
free (oldthread->specific);
|
||||||
#ifndef GUILE_PTHREAD_COMPAT
|
#ifndef GUILE_PTHREAD_COMPAT
|
||||||
free (oldthread->sto);
|
free (oldthread->sto);
|
||||||
free (oldthread);
|
free (oldthread);
|
||||||
#else
|
#else
|
||||||
oldthread->n_keys = 0;
|
|
||||||
coop_qput (&coop_deadq, oldthread);
|
coop_qput (&coop_deadq, oldthread);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue