Dan Kegel wrote:
So you suggest to not set a name ?Christian Costa wrote: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 ?It doesn't compile under MSVC, I bet. But I haven't tried it, perhaps it does.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.
In that case our InitializeCriticalSection macro would have one more parameter (the name) than the real function.
Nope. It wouldn't. We would construct the name from __FILE__ and __LINE__.
- Dan
What happened if there are two or more critical sections in the same source file, a file that has changed.
Having no name make things harder to distinguish them in a log.
OK, it is a little paranoid. :-)
Christian