MCPcopy Create free account
hub / github.com/beefytech/Beef / CheckLockYield

Method CheckLockYield

IDEHelper/Compiler/BfSystem.cpp:3879–3903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3877}
3878
3879void BfSystem::CheckLockYield()
3880{
3881 if (mYieldDisallowCount != 0)
3882 return;
3883
3884 //uint32 curTime = BFTickCount();
3885 //int yieldTime = (int)(curTime - mYieldTickCount);
3886 //mHighestYieldTime = BF_MAX(yieldTime, mHighestYieldTime);
3887 //mYieldTickCount = curTime;
3888
3889 if ((mPendingSystemLockPri > mCurSystemLockPri) && (mCurSystemLockThreadId == BfpThread_GetCurrentId()))
3890 {
3891 int mySystemLockPri = mCurSystemLockPri;
3892 BF_ASSERT(mSystemLock.mLockCount == 1);
3893 mSystemLock.Unlock();
3894 // Wait for the other thread to actually acquire the lock. This only spins between the time
3895 // we get a NotifyWillRequestLock and when that thread actually does the Lock
3896 while (mPendingSystemLockPri != -1)
3897 {
3898 BfpThread_Yield();
3899 }
3900 Lock(mySystemLockPri);
3901 mCurSystemLockThreadId = BfpThread_GetCurrentId();
3902 }
3903}
3904
3905void BfSystem::NotifyWillRequestLock(int priority)
3906{

Callers 7

VisitCodeBlockMethod · 0.45
PopulateReifiedMethod · 0.45
CompileReifiedMethod · 0.45
DoCompileMethod · 0.45
VisitMethod · 0.45

Calls 4

BfpThread_GetCurrentIdFunction · 0.50
BfpThread_YieldFunction · 0.50
LockFunction · 0.50
UnlockMethod · 0.45

Tested by

no test coverage detected