[PATCH] CriticalSection SpinCount Implementation

Ryan Cumming ryan at completely.kicks-ass.org
Fri Sep 13 12:28:24 CDT 2002


The following patch implements all the goo related to SpinCount, by doing the 
following:
1) Implement RtlSetCriticalSectionSpinCount and make 
SetCriticalSectionSpinCount call down to it.
2) A bit more NtQuerySystemInformation implementation so we can determine if 
we're running as UP or SMP from within NTDLL. This is important, because 
SetCriticalSectionSpinCount and RtlInitializeCriticalSectionAndSpinCount have 
different semantics under the two environments.
3) Make RtlInitializeCriticalSection call 
RtlInitializeCriticalSectionAndSpinCount. This prevents the former call from 
creating a critical section with an uninitialized SpinCount value as it was 
before.
4) Make RtlpWaitForCriticalSection spin SpinCount times before calling 
WaitForSingleObject

-Ryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spin-count.diff
Type: text/x-diff
Size: 7472 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20020913/0730e8c0/spin-count.bin


More information about the wine-patches mailing list