1 |
/* Copyright (C) 1998,1999,2000,2001 Free Software Foundation, Inc. |
/* Copyright (C) 1998,1999,2000,2001, 2002 Free Software Foundation, Inc. |
2 |
* |
* |
3 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
4 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
1478 |
static long n_hell = 1; /* one place for the evil one himself */ |
static long n_hell = 1; /* one place for the evil one himself */ |
1479 |
static long hell_size = 4; |
static long hell_size = 4; |
1480 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
1481 |
static scm_t_mutex hell_mutex; |
static SCM hell_mutex; |
1482 |
#endif |
#endif |
1483 |
|
|
1484 |
static long |
static long |
1496 |
{ |
{ |
1497 |
SCM obj = SCM_PACK ((scm_t_bits) o); |
SCM obj = SCM_PACK ((scm_t_bits) o); |
1498 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
1499 |
scm_mutex_lock (&hell_mutex); |
scm_lock_mutex (hell_mutex); |
1500 |
#endif |
#endif |
1501 |
if (n_hell == hell_size) |
if (n_hell == hell_size) |
1502 |
{ |
{ |
1506 |
} |
} |
1507 |
hell[n_hell++] = SCM_STRUCT_DATA (obj); |
hell[n_hell++] = SCM_STRUCT_DATA (obj); |
1508 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
1509 |
scm_mutex_unlock (&hell_mutex); |
scm_unlock_mutex (hell_mutex); |
1510 |
#endif |
#endif |
1511 |
} |
} |
1512 |
|
|
1514 |
go_to_heaven (void *o) |
go_to_heaven (void *o) |
1515 |
{ |
{ |
1516 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
1517 |
scm_mutex_lock (&hell_mutex); |
scm_lock_mutex (hell_mutex); |
1518 |
#endif |
#endif |
1519 |
hell[burnin (SCM_PACK ((scm_t_bits) o))] = hell[--n_hell]; |
hell[burnin (SCM_PACK ((scm_t_bits) o))] = hell[--n_hell]; |
1520 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
1521 |
scm_mutex_unlock (&hell_mutex); |
scm_unlock_mutex (hell_mutex); |
1522 |
#endif |
#endif |
1523 |
} |
} |
1524 |
|
|
2696 |
|
|
2697 |
hell = scm_malloc (hell_size); |
hell = scm_malloc (hell_size); |
2698 |
#ifdef USE_THREADS |
#ifdef USE_THREADS |
2699 |
scm_mutex_init (&hell_mutex); |
hell_mutex = scm_permanent_object (scm_make_mutex ()); |
2700 |
#endif |
#endif |
2701 |
|
|
2702 |
create_basic_classes (); |
create_basic_classes (); |