mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows: use spin counts for osi base locks
On multiprocessor systems, spin counts are faster than entering a processor wait state when there is critical section contention. Microsoft recommends a count of 4000. This feature is only available on XP and above which is fine since OpenAFS master and 1.7 no longer support Windows 2000. Change-Id: I1b40d00b2a91e60e1676a53e1c38eb5f9bfadc69 Reviewed-on: http://gerrit.openafs.org/7719 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
f4baf7cf99
commit
d5f067aa73
@ -35,7 +35,7 @@ void osi_BaseInit(void)
|
||||
int i;
|
||||
|
||||
for(i=0; i<OSI_MUTEXHASHSIZE; i++)
|
||||
InitializeCriticalSection(&osi_baseAtomicCS[i]);
|
||||
InitializeCriticalSectionAndSpinCount(&osi_baseAtomicCS[i], 4000);
|
||||
|
||||
if ((tls_LockRefH = TlsAlloc()) == TLS_OUT_OF_INDEXES)
|
||||
osi_panic("TlsAlloc(tls_LockRefH) failure", __FILE__, __LINE__);
|
||||
@ -43,7 +43,7 @@ void osi_BaseInit(void)
|
||||
if ((tls_LockRefT = TlsAlloc()) == TLS_OUT_OF_INDEXES)
|
||||
osi_panic("TlsAlloc(tls_LockRefT) failure", __FILE__, __LINE__);
|
||||
|
||||
InitializeCriticalSection(&lock_ref_CS);
|
||||
InitializeCriticalSectionAndSpinCount(&lock_ref_CS, 4000);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user