1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* guardians.c (guardian_print): for sharing guardians, print that

they are sharing.
(scm_guard, scm_get_one_zombie): place the critical section
barriers more correctly.
This commit is contained in:
Michael Livshin 2000-12-30 19:26:37 +00:00
parent d9dcd93362
commit 75bc0690c8
2 changed files with 22 additions and 7 deletions

View file

@ -1,5 +1,10 @@
2000-12-30 Michael Livshin <mlivshin@bigfoot.com>
* guardians.c (guardian_print): for sharing guardians, print that
they are sharing.
(scm_guard, scm_get_one_zombie): place the critical section
barriers more correctly.
* weaks.c (scm_scan_weak_vectors): move the calculation of the
`weak_keys' and `weak_values' flags out of the inner loop.

View file

@ -182,6 +182,8 @@ guardian_print (SCM g, SCM port, scm_print_state *pstate)
scm_puts ("#<", port);
if (GUARDIAN_GREEDY_P (g))
scm_puts ("greedy ", port);
else
scm_puts ("sharing ", port);
scm_puts ("guardian (reachable: ", port);
scm_display (scm_length (SCM_CDR (GUARDIAN_LIVE (g).head)), port);
scm_puts (" unreachable: ", port);
@ -216,24 +218,30 @@ scm_guard (SCM guardian, SCM obj)
{
SCM z;
SCM_NEWCELL (z);
/* This critical section barrier will be replaced by a mutex. */
SCM_DEFER_INTS;
if (GUARDIAN_GREEDY_P (guardian))
{
if (SCM_NFALSEP (scm_hashq_get_handle
(greedily_guarded_whash, obj)))
scm_misc_error ("guard",
"object is already greedily guarded", obj);
{
SCM_ALLOW_INTS;
scm_misc_error ("guard",
"object is already greedily guarded", obj);
}
else
scm_hashq_create_handle_x (greedily_guarded_whash,
obj, guardian);
}
SCM_NEWCELL (z);
/* This critical section barrier will be replaced by a mutex. */
SCM_DEFER_INTS;
TCONC_IN (GUARDIAN_LIVE (guardian), obj, z);
SCM_ALLOW_INTS;
}
}
@ -244,15 +252,17 @@ scm_get_one_zombie (SCM guardian)
/* This critical section barrier will be replaced by a mutex. */
SCM_DEFER_INTS;
if (!TCONC_EMPTYP (GUARDIAN_ZOMBIES (guardian)))
TCONC_OUT (GUARDIAN_ZOMBIES (guardian), res);
SCM_ALLOW_INTS;
if (SCM_NFALSEP (res)
&& GUARDIAN_GREEDY_P (guardian)
&& SCM_NFALSEP (scm_hashq_get_handle
(greedily_guarded_whash, res)))
scm_hashq_remove_x (greedily_guarded_whash, res);
SCM_ALLOW_INTS;
return res;
}