From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feJR5-0006Ko-Oz for guix-patches@gnu.org; Sat, 14 Jul 2018 08:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feJR4-0007b2-K9 for guix-patches@gnu.org; Sat, 14 Jul 2018 08:14:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51656) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1feJR4-0007aj-FY for guix-patches@gnu.org; Sat, 14 Jul 2018 08:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1feJR4-00055y-1k for guix-patches@gnu.org; Sat, 14 Jul 2018 08:14:02 -0400 Subject: [bug#32121] [PATCH 2/5] utils: Reset the Fiber dynamic environment in %NON-BLOCKING. Resent-Message-ID: References: <20180710230247.16639-1-clement@lassieur.org> <20180710230247.16639-2-clement@lassieur.org> <87bmbbmt2x.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87bmbbmt2x.fsf@gnu.org> Date: Sat, 14 Jul 2018 14:13:50 +0200 Message-ID: <87k1pyf20x.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 32121@debbugs.gnu.org Ludovic Court=C3=A8s writes: > Cl=C3=A9ment Lassieur 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-T= HREAD. >> 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=E2=80=99s a GitHub thing o= r you > can email guile-user I guess)? Sure! Thank you, Cl=C3=A9ment