From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Native module callback when Lisp thread exits Date: Sat, 18 May 2024 18:49:13 +0300 Message-ID: <86o793ce86.fsf@gnu.org> References: <86msoofg5o.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, mshinwell@janestreet.com To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 18 17:50:03 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 1s8MJs-0002l8-93 for ged-emacs-devel@m.gmane-mx.org; Sat, 18 May 2024 17:50:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8MJC-0008RH-0t; Sat, 18 May 2024 11:49:18 -0400 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 1s8MJB-0008Qg-20 for emacs-devel@gnu.org; Sat, 18 May 2024 11:49:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8MJA-0000bF-Kz; Sat, 18 May 2024 11:49:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hahJNxd+o9DKrt6oNu3azLs+XIZNIhWrpaR2jaAWJIA=; b=jgeE+KV80RIT Bd2t0dw+SFSlQUvp8jR/jgkDh2rFzUAMa+EZLFPWvhYR87732SHs/VbnAEM0e90413N3HU/nYPLVg jQddYVc1eMSGDDfwsJurAuMhE+VQF1J+ugJ5MLruhLdpchBWd6bU7Zr+pzCeYoQds9ewGMa1jeSiB 1VYG6RZyRi0kE2KHuQVdDQEfhX5Q8ti6o1AY9QkzZyk8pP9snoyWS9/JLGCXSFlb1CncqPv/2LiHI QIsRANqAMbX9HxwXykHAJnJd/8j0DBglTjs4GK1+iI9pcalyjN0OuDbW0rnMa7YN4NaBgfN1AnBw5 OK6+C7a6oS6IzPj3qkLDpQ==; In-Reply-To: (message from Spencer Baugh on Sat, 18 May 2024 09:56:26 -0400) 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:319349 Archived-At: > From: Spencer Baugh > Cc: emacs-devel@gnu.org, mshinwell@janestreet.com > Date: Sat, 18 May 2024 09:56:26 -0400 > > Eli Zaretskii writes: > > I don't understand why you need something module-specific. Shouldn't > > a thread-exit-hook be enough? We could easily add that if that helps. > > Yes, that would be enough. > > Although I'm now realizing that this could be done in my native module > by passing a destructor to pthread_key_create, so maybe I don't need > anything in Emacs after all. If you don't care about portability to systems that don't use pthreads for implementing the Lisp threads, then I guess you can do that as well.