| 3877 | } |
| 3878 | |
| 3879 | void 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 | |
| 3905 | void BfSystem::NotifyWillRequestLock(int priority) |
| 3906 | { |
no test coverage detected