Changeset 5313

Show
Ignore:
Timestamp:
07/17/06 16:50:03
Author:
robert
Message:

From Adrian Egli, replaced Sleep(0) wit SwitchToThread? to avoid thread performance problems.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenThreads/trunk/win32_src/Win32Mutex.cpp

    r2066 r5313  
    4949unsigned WIN32MutexSpin <instance>::__last = 0; 
    5050 
     51 
     52 
    5153static void _S_nsec_sleep(int __log_nsec) { 
    5254 
    5355    if (__log_nsec <= 20) { 
    54         Sleep(0); 
    55      } else { 
     56        SwitchToThread(); //Sleep(0); // adegli replaced it Sleep by SwitchToThread 
     57       } else { 
    5658        Sleep(1 << (__log_nsec - 20)); 
    57      
     59       
    5860} 
    5961 
  • OpenThreads/trunk/win32_src/Win32MutexPrivateData.h

    r2066 r5313  
    2424#define _Win32MUTEXPRIVATEDATA_H_ 
    2525 
     26 
    2627#ifndef _WINDOWS_ 
    2728#define WIN32_LEAN_AND_MEAN 
     29#define _WIN32_WINNT 0x0400  // was missing : adegli 
    2830#include <windows.h> 
    2931#endif 
    30  
    3132namespace OpenThreads { 
    3233