From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Crash at startup in Cygwin w32 build on emacs-25 branch Date: Sat, 28 Nov 2015 10:18:03 +0200 Message-ID: <83d1uur0zo.fsf@gnu.org> References: <86bnagfgf7.fsf@gmail.com> <83d1uvuawp.fsf@gnu.org> <86oaef2eiw.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1448698721 9912 80.91.229.3 (28 Nov 2015 08:18:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Nov 2015 08:18:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 28 09:18:29 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a2aiD-0007VV-2H for ged-emacs-devel@m.gmane.org; Sat, 28 Nov 2015 09:18:29 +0100 Original-Received: from localhost ([::1]:59942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2aiG-0003pP-D7 for ged-emacs-devel@m.gmane.org; Sat, 28 Nov 2015 03:18:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2ai4-0003pG-Kn for emacs-devel@gnu.org; Sat, 28 Nov 2015 03:18:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2ai0-0005BR-LF for emacs-devel@gnu.org; Sat, 28 Nov 2015 03:18:20 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:37395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2ai0-0005BJ-D1 for emacs-devel@gnu.org; Sat, 28 Nov 2015 03:18:16 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NYI00J00MKTTM00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 28 Nov 2015 10:18:14 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYI00JT8N2EPU80@a-mtaout21.012.net.il>; Sat, 28 Nov 2015 10:18:14 +0200 (IST) In-reply-to: <86oaef2eiw.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195437 Archived-At: > From: Andy Moreton > Date: Fri, 27 Nov 2015 23:44:55 +0000 > > > I couldn't imagine Cygwin needs the thread information. > > Only the Cygwin w32 build, which sets HAVE_NTGUI and uses the Windows > GUI code for display (so no need for an X11 server). Yes, I know. But the way the Cygwin w32 build gets input is very different from the native build. Threads other than the main one are used in the native build to receive messages from MS-Windows, in order to emulate the read-socket hook and some other Posix features (like interval timers). AFAIU, Cygwin reads from /dev/windows pseudo-device using the "normal" Posix reads from a file descriptor. That's why I didn't think about Cygwin in this case: I don't think it launches any non-main threads. > The module code also uses dwMainThreadId for error checking, and may > need similar changes for the Cygwin w32 build. The use of dwMainThreadId in emacs-module.c is guarded by WINDOWSNT, so is not compiled into the Cygwin w32 build. I believe the latter uses pthreads for that. > It may be safer to provide the thread ID from a function to ensure > that it has been initialised before callers try to use it. Not sure what you mean here. Do you mean use an accessor instead of a global variable? If so, I don't understand the rationale. > > Btw, it's high time you got write access to the repository. Would you > > like that? > > That would prbably make sense. What needs to be done to arrange that ? Get a Savannah account (http://savannah.gnu.org/account/register.php, I believe), then apply for membership in the Emacs project. Thanks.