From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juliusz Chroboczek Newsgroups: gmane.emacs.devel Subject: Re: Crashing the new thread code Date: Sun, 11 Dec 2016 23:56:19 +0100 Message-ID: <877f762hyk.fsf@irif.fr> References: <87h96a2tyi.fsf@irif.fr> <83twaacii3.fsf@gnu.org> <87d1gy2mat.fsf@irif.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1481497029 23189 195.159.176.226 (11 Dec 2016 22:57:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 22:57:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 23:57:06 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGD3J-0005JR-Kn for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 23:57:05 +0100 Original-Received: from localhost ([::1]:57437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGD3N-0006cW-VD for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 17:57:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGD2Z-0006bD-Gu for emacs-devel@gnu.org; Sun, 11 Dec 2016 17:56:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGD2V-00062w-Id for emacs-devel@gnu.org; Sun, 11 Dec 2016 17:56:19 -0500 Original-Received: from [195.159.176.226] (port=59847 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGD2V-00061i-C2 for emacs-devel@gnu.org; Sun, 11 Dec 2016 17:56:15 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cGD2M-0004Rs-S6 for emacs-devel@gnu.org; Sun, 11 Dec 2016 23:56:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:IOWrFabbjFpZFJzKm0u2qP1CWP4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210317 Archived-At: > I would expect the thread to receive the signal as soon as it starts > running again. I'm not sure what the semantics of signal-thread is supposed to be. The manual says: ‘thread-signal’ will cause a thread to exit a call to ‘mutex-lock’, ‘condition-wait’, or ‘thread-join’. I assumed this to mean that the condition will only be delivered when one of these functions is called, but your comment seems to imply that it's meant to deliver the condition as soon as possible. Which makes sense, but gives a whole new flavour to using unwind-protect now that conditions can be signalled asynchronously. (Aside: I'm actually not quite sure in that case that unwind-protect can be used safely at all. What happens if a condition is signalled during the cleanup? Say: (let ((foo nil)) (unwind-protect (progn (setq foo (make-foo)) (do-stuff-with foo)) (when foo (destroy-foo foo)))) if a condition is signalled just before the cleanup but after exiting the body, will we leak a foo? End of aside.) -- Juliusz