emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPROF + SIGCHLD and igc


From: Helmut Eller
Subject: Re: SIGPROF + SIGCHLD and igc
Date: Sat, 28 Dec 2024 20:28:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

On Sat, Dec 28 2024, Eli Zaretskii wrote:

> I guess they use PTHREAD_MUTEX_ERRORCHECK to get the error?

Yes, they do.

> Anyway, the MS-Windows implementation uses EnterCriticalSection, which
> allows a thread to call it any number of times after the first call
> succeeded, so they must be using something else on Windows to detect
> multiple locks by the same thread, maybe the count of claims or
> something?

The comment at the beginning of lockw3.c suggests so.  I think the AVER
assertions are only checked in the debug build.

 * .design: These are implemented using critical sections.
 *  See the section titled "Synchronization functions" in the Groups
 *  chapter of the Microsoft Win32 API Programmer's Reference.
 *  The "Synchronization" section of the Overview is also relevant.
 *
 *  Critical sections support recursive locking, so the implementation
 *  could be trivial.  This implementation counts the claims to provide
 *  extra checking.
 *
 *  The limit on the number of recursive claims is the max of
 *  ULONG_MAX and the limit imposed by critical sections, which
 *  is believed to be about UCHAR_MAX.
 *
 *  During use the claims field is updated to remember the number of
 *  claims acquired on a lock.  This field must only be modified
 *  while we are inside the critical section.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]