guix-patches
[Top][All Lists]
Advanced

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

[bug#32121] [PATCH 2/5] utils: Reset the Fiber dynamic environment in %N


From: Clément Lassieur
Subject: [bug#32121] [PATCH 2/5] utils: Reset the Fiber dynamic environment in %NON-BLOCKING.
Date: Sat, 14 Jul 2018 14:13:50 +0200
User-agent: mu4e 1.0; emacs 26.1

Ludovic Courtès <address@hidden> writes:

> Clément Lassieur <address@hidden> skribis:
>
>> * src/cuirass/utils.scm (%non-blocking): Wrap body in PARAMETERIZE form that
>> clears CURRENT-FIBER.
>>
>> So that PUT-MESSAGE doesn't try to suspend itself within 
>> CALL-WITH-NEW-THREAD.
>> See https://lists.gnu.org/archive/html/guile-devel/2018-07/msg00009.html.
>
> Good catch!
>
>> +  (parameterize (((@@ (fibers internal) current-fiber) #f))
>> +    (let ((channel (make-channel)))
>
> Instead of using @@, I think you can add an explicit:
>
>   #:use-module ((fibers internal) #:select (current-fiber))

That doesn't work because it would select the exported variable (as '@'
would have done), that is: the value of the parameter.  What I need is
the parameter itself, which is hidden.

See (fibers internal):

--8<---------------cut here---------------start------------->8---
  #:export ;; Low-level interface: schedulers and threads.

            [...]

            (current-fiber/public . current-fiber)
  [...]

(define current-fiber (make-parameter #f))
(define (current-fiber/public)
  "Return the current fiber, or @code{#f} if no fiber is current."
  (current-fiber))
--8<---------------cut here---------------end--------------->8---

> at the top.
>
> OK with this change!
>
> Could you also report the issue to Andy (there’s a GitHub thing or you
> can email guile-user I guess)?

Sure!

Thank you,
Clément





reply via email to

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