[Openmcl-devel] Odd lock behaviour.

Michał "phoe" Herda phoe at disroot.org
Wed Mar 11 09:20:44 PDT 2020


The created lock is a RECURSIVE-LOCK, meaning that it can be grabbed N
times by a single thread. In order to be released, it must be released
exactly N times by the same thread.

See https://en.wikipedia.org/wiki/Reentrant_mutex

On 11.03.2020 17:19, martin wrote:
> Hello All
> Is the following easily explained?
> Why is the lock grab-able at the breakpoint?
> The same experiment with the IDE (on Mac) shows the lock not grab-able
> in a second Listener, at the same time that it is grab-able inside the
> breakpoint on the first Listener.
> Martin
>
> Clozure Common Lisp Version 1.12-dev  DarwinX8664
>
> ? (defvar gg)
> GG
>
> ? (setf gg (make-lock))
> #<RECURSIVE-LOCK [ptr @ #x20E05300] #x302000A1D3ED>
>
> ? (with-lock-grabbed (gg) (break))
> > Break: Break
>
> 1 > (with-lock-grabbed (gg) 'foo)
> FOO
> 1 > 
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20200311/a697ac07/attachment.htm>


More information about the Openmcl-devel mailing list