mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Critical section review
This commit is contained in:
parent
13155c50c4
commit
a61b2054b4
3 changed files with 9 additions and 3 deletions
|
@ -231,7 +231,7 @@ SCM_API void gh_newline (void);
|
|||
#endif
|
||||
|
||||
#endif /* __GH_H */
|
||||
/* njrev: critical sections reviewed so far up to here */
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "gnu"
|
||||
|
|
|
@ -226,6 +226,7 @@ scm_guard (SCM guardian, SCM obj, int throw_p)
|
|||
SCM z;
|
||||
|
||||
/* This critical section barrier will be replaced by a mutex. */
|
||||
/* njrev: per comment above, should use a mutex. */
|
||||
SCM_CRITICAL_SECTION_START;
|
||||
|
||||
if (GREEDY_P (g))
|
||||
|
@ -245,6 +246,7 @@ scm_guard (SCM guardian, SCM obj, int throw_p)
|
|||
else
|
||||
scm_hashq_create_handle_x (greedily_guarded_whash,
|
||||
obj, guardian);
|
||||
/* njrev: this can throw a memory or out-of-range error. */
|
||||
}
|
||||
|
||||
z = scm_cons (SCM_BOOL_F, SCM_BOOL_F);
|
||||
|
@ -265,6 +267,7 @@ scm_get_one_zombie (SCM guardian)
|
|||
|
||||
/* This critical section barrier will be replaced by a mutex. */
|
||||
SCM_CRITICAL_SECTION_START;
|
||||
/* njrev: -> mutex */
|
||||
|
||||
if (!TCONC_EMPTYP (g->zombies))
|
||||
TCONC_OUT (g->zombies, res);
|
||||
|
@ -339,7 +342,9 @@ SCM_DEFINE (scm_guardian_destroyed_p, "guardian-destroyed?", 1, 0, 0,
|
|||
|
||||
/* This critical section barrier will be replaced by a mutex. */
|
||||
SCM_CRITICAL_SECTION_START;
|
||||
|
||||
/* njrev: Critical section not needed here. (Falls into category of
|
||||
stuff that is the responsibility of Scheme code, whenever
|
||||
accessing data from multiple threads.) */
|
||||
res = scm_from_bool (DESTROYED_P (GUARDIAN_DATA (guardian)));
|
||||
|
||||
SCM_CRITICAL_SECTION_END;
|
||||
|
|
|
@ -66,6 +66,7 @@ SCM_DEFINE (scm_symbol_to_keyword, "symbol->keyword", 1, 0, 0,
|
|||
SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, 0, NULL, "symbol");
|
||||
|
||||
SCM_CRITICAL_SECTION_START;
|
||||
/* njrev: NEWSMOB and hashq_set_x can raise errors */
|
||||
keyword = scm_hashq_ref (scm_keyword_obarray, symbol, SCM_BOOL_F);
|
||||
if (scm_is_false (keyword))
|
||||
{
|
||||
|
@ -105,7 +106,7 @@ scm_from_locale_keywordn (const char *str, size_t len)
|
|||
return scm_symbol_to_keyword (scm_from_locale_symboln (str, len));
|
||||
}
|
||||
|
||||
|
||||
/* njrev: critical sections reviewed so far up to here */
|
||||
void
|
||||
scm_init_keywords ()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue