From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: igc, macOS avoiding signals Date: Mon, 30 Dec 2024 17:57:02 +0100 Message-ID: <87msgdkt29.fsf@gmail.com> 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> 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="12528"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Pip Cet , Eli Zaretskii , spd@toadstyle.org, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 30 17:57:48 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 1tSJ5Q-000394-Cx for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Dec 2024 17:57:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSJ4o-0007OO-A5; Mon, 30 Dec 2024 11:57:10 -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 1tSJ4l-0007NC-P8 for emacs-devel@gnu.org; Mon, 30 Dec 2024 11:57:07 -0500 Original-Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSJ4k-000253-1T; Mon, 30 Dec 2024 11:57:07 -0500 Original-Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aa679ad4265so1872681166b.0; Mon, 30 Dec 2024 08:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735577824; x=1736182624; 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=m+Ua6DeUSbKVxTy7XomUfu05OHu2MjVU4Mb0HEOEPcA=; b=HkvNiKXvc3U1Xmr/hfxF0IJ/QBfMeUf1eTzKLLbsy+jpywNK2x3ErAR5aT8/CNgs1Y R1tAFZ2z6V3m3bE5Rj++M9nc/rmDgW7AY6xt6B0LOGf38bwGoOq6Es+Fk7GkebanMMjY yrmeZSjRopIxcQ38GroHZmUiSp9W8+C3hDb6e95N9AA8YzKgNpRN9kUmZrNr5+xM9bhh +9SAS6VgzSplSQCpRzgREJq44UcBGKyxXwTBCJ5B3uTaxx70Neh0e6ORB9RWKla8kKD2 4Mj3y/BK4yMk3RGqeJkTU+DQcdqg0I3rxxjMxtf36SyUBtzmt4lWMYyfPYMvqIbyt9VY AIWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735577824; x=1736182624; 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=m+Ua6DeUSbKVxTy7XomUfu05OHu2MjVU4Mb0HEOEPcA=; b=nL+YdqaXoptbVuqBm2nBkHuk85crDRxuvIbSODmgrS1RqSkqK5OvhYTsBkEWNAdSnH sg+oLUM+nM09/TVHXJuUxOoDGIIKRm/H/8rHFeDIG8z31VSTboHcWLqRqP62Qjte2vLN 1tbP9CHkZnU5r7joD4lPs7/KygVp2Fkns4grEjytmzYGUyCUN4Y2LMaWzv4LBJaJERve J6cco7GiLCvWQYXZd5NALFy2Apn10Z2/QGmJWHS31t52xPEcoGAmSWhqjRz2zUArtUCn 1k73CzrEfrlypgWpJ3s7J0BmQkyH1A1M+7E9nIHS611bWVq2EJ18JpbWvuSFU2ju4LvN u5CQ== X-Forwarded-Encrypted: i=1; AJvYcCUAkgE0OUSIJ0LRnx4CMSrG+Rs/BIybYoHb49rIc9s2pebRSQtIaMlwaAAPVYIhDXdBD7ePAissBVKOvmo=@gnu.org, AJvYcCW7uiEp+++PaQJ5qDc2kn2mIhJN+DhizjVYZqaS10P+Y8MYoclpz20PGGHehD75LJ0H0oZr@gnu.org X-Gm-Message-State: AOJu0YxfNLMF0CnsJeFspbvjZYvu3qyUyd95/NwK2Xu01y3KdxCHLFPi 1UgTa7QF+9ExSByqdk9Wog39eWRfM7+M+Ocwyz/N+qibBxDujOtpU4whu4J5 X-Gm-Gg: ASbGnctotReKZsewT0P3DPRpr8OHZ5wPYN/NoA8xvl2eDwGR5wscOcxpxEMtDGmr0GJ ueDqBAbs0xUYnIbVR5ZYN1tCZp+QKQ9uNvh8rhWFQv1d/3zLuWSa9iB6Ea0pP9War1gM4SDdk7s ju6ACr6U7NgaWVI8A9Bw8bv6xazxpQhtt2Frne0EKbWl1SYaeb+qEISUbiR1bFM1k5jwDL/Rj+m ZIk4yoc7ZyPI+1aXl9enx/0druZeAxDz5Rr2riUryVrxZ/KRsp49W0= X-Google-Smtp-Source: AGHT+IHc7sgiX9PeQVnQKppV/3PsgWn6waJzo7amdKmu3qwDVmLzQ8nPRvF50UVvzpNs4+gp86iF8w== X-Received: by 2002:a17:907:94c7:b0:aab:a02c:764e with SMTP id a640c23a62f3a-aac081547d2mr3797701366b.14.1735577823511; Mon, 30 Dec 2024 08:57:03 -0800 (PST) Original-Received: from caladan ([31.177.115.143]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f06542fsm1476662966b.176.2024.12.30.08.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Dec 2024 08:57:03 -0800 (PST) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann=22'?= =?utf-8?Q?s?= message of "Mon, 30 Dec 2024 16:30:44 +0100") Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x62f.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:327449 Archived-At: On Mon, Dec 30 2024, Gerd M=C3=B6llmann wrote: > 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 back > 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. 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. Helmut