From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: igc, macOS avoiding signals Date: Mon, 30 Dec 2024 19:37:38 +0100 Message-ID: References: <799DDBC5-2C14-4476-B1E0-7BA2FE9E7901@toadstyle.org> <87h66loc17.fsf@gmail.com> <878qrxoayj.fsf@gmail.com> <8734i5o6wc.fsf@gmail.com> <87cyh9mpn5.fsf@gmail.com> <874j2l1hei.fsf@protonmail.com> <874j2lmd37.fsf@gmail.com> <87msgdkt29.fsf@gmail.com> <86h66lnjrt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21445"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , pipcet@protonmail.com, spd@toadstyle.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 30 19:38:05 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tSKeT-0005Oc-2z for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Dec 2024 19:38:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSKeA-0006e9-QG; Mon, 30 Dec 2024 13:37:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSKe8-0006dm-KL for emacs-devel@gnu.org; Mon, 30 Dec 2024 13:37:44 -0500 Original-Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSKe6-0005Sf-QH; Mon, 30 Dec 2024 13:37:43 -0500 Original-Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d8de655efaso1046466a12.1; Mon, 30 Dec 2024 10:37:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735583861; x=1736188661; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZgttuawV+McfZ+SbP8s0c3NHGePZIVMAKnZUrbGcUXY=; b=dt0TkfrF3r3yHn9/NqP5g2SElx4pfI7KIlHE46f5XEQEaydGvztmSMmFGejsvn0eF3 mN+1lt0rXII9+FHKWjZvkMpPhk1m8qH2pZwboCAjiedNU/tzXcPZRZMQcBXlE/bwDhZW VadGtIu49nNbz5SFyKWgUBfBxq1Rxbo5cSgJK4/VQPGMy8dRrcY8OG9/NBAJJjpCwX71 4Q3gKfpdlvyzQFXWgPgwZxsCavi6j0uFqdxSWodDhRCcXO1ZZAcH+wVOKme9DnvsTL5S /JUUWek4R5FvgMzZeuXepKOJsVsDfAqbjls96qCC1qI8YLGUZ3PaypOoOKJIoSM75Z7m ASYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735583861; x=1736188661; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZgttuawV+McfZ+SbP8s0c3NHGePZIVMAKnZUrbGcUXY=; b=m1jxmg00kNzyeHTQZHFs9XR00/DwM7KjrmfIgkpzB9oD5zJ3bS/sJ22fmAi8wHM0QL EaB2mfCaErIy+CSMLWR+d8Gp4GGS8EX45DxOBT43d5icpFO788Q8VXdg0F6tm2GQNkOP Z6GLQKTCfuWtFIwIRjCbiLr8So3IOj6g/VkW4RKo+4gxRBwHgof1+HPONbTZe87mr2i8 Cdr715SttXb0eW1WiptDG0VD5aY70jgsNYlw9/QU3J4gQW7vt0wXyVhfcE60FWOyYfM4 Q/2aRWEebFpfPlqh+yvvsPXr8mXWY5IolW6oT1P0noB9q4DRGf/hTYOdzKaueeHlSmgW goDw== X-Forwarded-Encrypted: i=1; AJvYcCVTnxAeuaX6n3kI7w9nMKh02Dn8/MvS2lrIU9w5snBTuE4KOID90yindJWNEjBW5oxzDlmQ94szYLZouQ==@gnu.org X-Gm-Message-State: AOJu0YwY077lpVfEVHhUGkYdIUoLdRjzoY4i4x/R8auIDAIW34sg71t7 4Ahvng6M57qYBDPuMqa8LkqrsGEWUGHMBlNPm9O6/AK69mNumLK2Qm3bIw== X-Gm-Gg: ASbGncvax4WVsIq9AT1icZGkuu7j4NmH059GtKvYLwlXWEpWwKwgXFQ4higDm3s61TU dKB6nh2yHYsQmLov/bC/QdP9FGCgCbTQ7dUoPptjRWbygSCU2zIPi5SUI5opcDbjx/7xNsoBW3Q YTUrW5pkz/NWgpDruvJXlQfr1lFpJxSLytoiIoEiPaLuWXLH0VTYRorm6Krc+aswdMAH8ZGkKsW 4ZPDHDjpMLSkk1Bt7qWhGLkjX7ECsiggDLa7b5cFBU9kVmJxCT5BLQNujufBvy6ThBEr9noIPZT EYyDqtzcxLXQzKXiEH7cxCwwCW4ncS1g1oTX9eoBvMayM2YKoYtdt+OcicRQWm8/ X-Google-Smtp-Source: AGHT+IFuaGhgDWfq4pdyc2vM9DbP6e4xDfg/1Y5U6df6CM5OhqFfLrgaUhX1I3cuU37oXusw7Kazdw== X-Received: by 2002:a05:6402:388d:b0:5d2:729f:995f with SMTP id 4fb4d7f45d1cf-5d81de08a7bmr30228914a12.29.1735583860392; Mon, 30 Dec 2024 10:37:40 -0800 (PST) Original-Received: from pro2 (p200300e0b7156f000dceccb84ca1ba38.dip0.t-ipconnect.de. [2003:e0:b715:6f00:dce:ccb8:4ca1:ba38]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d80701abd1sm15003260a12.76.2024.12.30.10.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2024 10:37:40 -0800 (PST) In-Reply-To: <86h66lnjrt.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Dec 2024 19:49:26 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327463 Archived-At: Eli Zaretskii writes: >> From: Helmut Eller >> Cc: Pip Cet , Eli Zaretskii , >> spd@toadstyle.org, emacs-devel@gnu.org >> Date: Mon, 30 Dec 2024 17:57:02 +0100 >>=20 >> On Mon, Dec 30 2024, Gerd M=C3=B6llmann wrote: >>=20 >> > Bool (LockIsHeld)(Lock lock) >> > { >> > AVERT(Lock, lock); >> > if (pthread_mutex_trylock(&lock->mut) =3D=3D 0) { >> > Bool claimed =3D lock->claims > 0; >> > int res =3D pthread_mutex_unlock(&lock->mut); >> > AVER(res =3D=3D 0); >> > return claimed; >> > } >> > return TRUE; >> > } >> > >> > There might be a small window after pthread_mutex_trylock and being ba= ck >> > in the signal handler. Can anything happen in this window? >> > >> > If no other Emacs threads are running, and the Emacs thread is in the >> > signal handler, we can trust the "false" from the mps_arena_busy. >>=20 >> Theoretically, a signal handler could interrupt the Emacs thread and >> lock the mutex without unlocking it. That would be a very unusual >> signal handler. I hope no other surprises happen in signal handlers. > > We should keep our signal handlers very simple and safe, that's true. > It is not very hard, and much of that work was already done, when we > stopped running complex stuff in SIGIO handler etc. So, to summarize, everyone agrees with Helmut?=20