RtlpWaitForCriticalSection?

Christian Costa titan.costa at wanadoo.fr
Thu Jan 23 02:07:42 CST 2003


Dan Kegel wrote:

> Christian Costa wrote:
>
>>>> I think, It would be cool to have all locks named and thus make
>>>> debugging and bug report easier.
>>>> It's not a hard task but names must be meaningfull. :-)
>>>
>>>
>>> I guess you mean all Wine locks should be named
>>
>>
>> Yes! :-)
>>
>>> ...
>>> Naming the Wine locks would be nice (or is it done already?).
>>
>>
>> No, it isn't.
>
>
> 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? :-)

>
> 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.
So in the code, we can do :

.................
InitializeCriticalSection(&crit);
SET_CRITICAL_SECTION_NAME(&crit,"name");
..................

>
>
>>> But more
>>> than meaningful names, what we would need are grep-able names :-)
>>>
>> What do you mean with grep-able ?
>
>
> Ones that are easy to search for, e.g. that contain
> the source filename.

The filename could be added to the name with the macro I mentionned above.
CRITICAL_SECTION_INIT does that (__FILE__ ": " name).

Christian.





More information about the wine-devel mailing list