Call sched_yield directly for Sleep(0) (dotnet/coreclr#12063)
authorKoundinya Veluri <kouvel@microsoft.com>
Sat, 3 Jun 2017 00:04:17 +0000 (17:04 -0700)
committerGitHub <noreply@github.com>
Sat, 3 Jun 2017 00:04:17 +0000 (17:04 -0700)
Related to PR dotnet/coreclr#12057

Commit migrated from https://github.com/dotnet/coreclr/commit/b47b138d595267315008885e6ac7e2f4322cc5a9

src/coreclr/src/pal/src/include/pal/corunix.hpp
src/coreclr/src/pal/src/synchmgr/synchmanager.cpp
src/coreclr/src/pal/src/synchmgr/synchmanager.hpp
src/coreclr/src/pal/src/synchmgr/wait.cpp

index e7f58ed..e9e9503 100644 (file)
@@ -1098,10 +1098,6 @@ namespace CorUnix
             ) = 0;
 
         virtual
-        void
-        YieldThread() = 0;
-
-        virtual
         PAL_ERROR
         AbandonObjectsOwnedByThread(
             CPalThread *pCallingThread,
index a4730cf..73b5644 100644 (file)
@@ -434,11 +434,6 @@ namespace CorUnix
         return palErr;
     }
 
-    void CPalSynchronizationManager::YieldThread()
-    {
-        sched_yield();
-    }
-
     PAL_ERROR CPalSynchronizationManager::ThreadNativeWait(
         ThreadNativeWaitData * ptnwdNativeWaitData,
         DWORD dwTimeout,
index de8014b..883d5b8 100644 (file)
@@ -824,8 +824,6 @@ namespace CorUnix
             ThreadWakeupReason *ptwrWakeupReason,
             DWORD *pdwSignaledObject);
 
-        virtual void YieldThread();
-
         virtual PAL_ERROR AbandonObjectsOwnedByThread(
             CPalThread *pthrCurrent,
             CPalThread *pthrTarget);
index 8d184e0..8ef65aa 100644 (file)
@@ -702,7 +702,7 @@ DWORD CorUnix::InternalSleepEx (
     }
     else
     {
-        g_pSynchronizationManager->YieldThread();
+        sched_yield();
         dwRet = 0;
     }