guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code review for thread safeness


From: Marius Vollmer
Subject: Re: Code review for thread safeness
Date: Tue, 06 Dec 2005 20:58:28 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> Marius Vollmer <address@hidden> writes:
>>
>> If there might be non-local exits, scm_frame_critical_section can be
>> used instead.
>
> If an error occurs and a lazy-catch executes, is the mutex unlocked
> for that handler?

No, the handlers of the lazy-catch execute in the same dynamic context
as the (throw ...) that started them.

I guess you are worried about what happens when the lazy handler tries
to enter the critical section (or another one that uses the same
mutex) again.  I think this is covered by this from the manual:

     When the current thread reenters the critical section anyway, the
     kind of MUTEX determines what happens: When MUTEX is recursive,
     the reentry is allowed.  When it is a normal mutex, an error is
     signalled.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

[Prev in Thread] Current Thread [Next in Thread]