Dan Kegel wrote:
Christian Costa wrote:All the static CRITICAL_SECTIONs in Wine DLLs have names.
The only unnamed ones are those that are initialized at runtime.It is what I said! No? :-)I guess I missed part of what you said, sorry.To give these a name, we'd either have to convert them to static initialization, or change InitializeCriticalSection to somehow generate a name from the caller's program counter.
What about writing a new macro that initializes the name in the CRITICAL_SECTION struct.
.................
InitializeCriticalSection(&crit);
SET_CRITICAL_SECTION_NAME(&crit,"name");
Hmm. Seems to be the Wine DLL sources should try to avoid stuff that doesn't compile under Windows. That said, we could provide a header file that defined SET_CRITICAL_SECTION_NAME in Windows, and made it do nothing.
If CRITICAL_SECTION_INIT compiles why not SET_CRITICAL_SECTION_NAME ?
In that case our InitializeCriticalSection macro would have one more parameter (the name)
Furthermore, we could be real sneaky, and make that header file turn
InitializeCriticalSection into a macro
that called the real InitializeCriticalSection,
then called SET_CRITICAL_SECTION_NAME,
so no source changes would be needed to get the name in there, maybe.
than the real function.
I personaly think this will confused people more than an optional (but preferable for debugging) macro.
Christian.