Changeset 20784 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jun 22, 2009 2:37:39 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48904
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/TMAll.cpp
r20778 r20784 66 66 67 67 68 #ifndef tm Lock69 70 /** 71 * Try take the EMT/TMlock, wait in ring-3 return VERR_SEM_BUSY in R0/RC.68 #ifndef tmTimerLock 69 70 /** 71 * Try take the timer lock, wait in ring-3 return VERR_SEM_BUSY in R0/RC. 72 72 * 73 73 * @retval VINF_SUCCESS on success (always in ring-3). … … 75 75 * 76 76 * @param pVM The VM handle. 77 */ 78 int tmLock(PVM pVM) 77 * 78 * @thread EMTs for the time being. 79 */ 80 int tmTimerLock(PVM pVM) 79 81 { 80 82 VM_ASSERT_EMT(pVM); 81 int rc = PDMCritSectEnter(&pVM->tm.s. EmtLock, VERR_SEM_BUSY);83 int rc = PDMCritSectEnter(&pVM->tm.s.TimerCritSect, VERR_SEM_BUSY); 82 84 return rc; 83 85 } … … 85 87 86 88 /** 87 * Try take the EMT/TMlock, no waiting.89 * Try take the timer lock, no waiting. 88 90 * 89 91 * @retval VINF_SUCCESS on success. … … 92 94 * @param pVM The VM handle. 93 95 */ 94 int tmTryLock(PVM pVM) 95 { 96 VM_ASSERT_EMT(pVM); 97 int rc = PDMCritSectTryEnter(&pVM->tm.s.EmtLock); 96 int tmTimerTryLock(PVM pVM) 97 { 98 int rc = PDMCritSectTryEnter(&pVM->tm.s.TimerCritSect); 98 99 return rc; 99 100 } … … 105 106 * @param pVM The VM handle. 106 107 */ 107 void tm Unlock(PVM pVM)108 { 109 PDMCritSectLeave(&pVM->tm.s. EmtLock);108 void tmTimerUnlock(PVM pVM) 109 { 110 PDMCritSectLeave(&pVM->tm.s.TimerCritSect); 110 111 } 111 112 … … 261 262 PVM pVM = pTimer->CTX_SUFF(pVM); 262 263 if ( VM_IS_EMT(pVM) 263 && RT_SUCCESS(tmT ryLock(pVM)))264 && RT_SUCCESS(tmTimerTryLock(pVM))) 264 265 { 265 266 STAM_PROFILE_START(&pVM->tm.s.CTX_SUFF_Z(StatScheduleOne), a); … … 270 271 #endif 271 272 STAM_PROFILE_STOP(&pVM->tm.s.CTX_SUFF_Z(StatScheduleOne), a); 272 tm Unlock(pVM);273 tmTimerUnlock(pVM); 273 274 } 274 275 else … … 817 818 818 819 STAM_COUNTER_INC(&pVM->tm.s.StatTimerSetOpt); 819 tm Unlock(pVM);820 tmTimerUnlock(pVM); 820 821 return VINF_SUCCESS; 821 822 } … … 866 867 { 867 868 /* Try take the TM lock and check the state again. */ 868 if (RT_SUCCESS_NP(tmT ryLock(pVM)))869 if (RT_SUCCESS_NP(tmTimerTryLock(pVM))) 869 870 { 870 871 if (RT_LIKELY(tmTimerTry(pTimer, TMTIMERSTATE_ACTIVE, enmState))) … … 874 875 return VINF_SUCCESS; 875 876 } 876 tm Unlock(pVM);877 tmTimerUnlock(pVM); 877 878 } 878 879 } … … 1041 1042 1042 1043 STAM_COUNTER_INC(&pVM->tm.s.StatTimerSetRelativeOpt); 1043 tm Unlock(pVM);1044 tmTimerUnlock(pVM); 1044 1045 return VINF_SUCCESS; 1045 1046 } … … 1092 1093 * get the innermost locks. 1093 1094 */ 1094 bool fOwnTMLock = RT_SUCCESS_NP(tmT ryLock(pVM));1095 bool fOwnTMLock = RT_SUCCESS_NP(tmTimerTryLock(pVM)); 1095 1096 #if 1 1096 1097 if ( fOwnTMLock … … 1248 1249 if (!fOwnTMLock) 1249 1250 { 1250 fOwnTMLock = RT_SUCCESS_NP(tmT ryLock(pVM));1251 fOwnTMLock = RT_SUCCESS_NP(tmTimerTryLock(pVM)); 1251 1252 if ( !fOwnTMLock 1252 1253 && enmClock == TMCLOCK_VIRTUAL_SYNC … … 1263 1264 tmVirtualSyncUnlock(pVM); 1264 1265 if (fOwnTMLock) 1265 tm Unlock(pVM);1266 tmTimerUnlock(pVM); 1266 1267 1267 1268 if ( !fOwnTMLock … … 2035 2036 void tmTimerQueueSchedule(PVM pVM, PTMTIMERQUEUE pQueue) 2036 2037 { 2037 TM_ASSERT_ EMT_LOCK(pVM);2038 TM_ASSERT_LOCK(pVM); 2038 2039 2039 2040 /* … … 2076 2077 void tmTimerQueuesSanityChecks(PVM pVM, const char *pszWhere) 2077 2078 { 2078 TM_ASSERT_ EMT_LOCK(pVM);2079 TM_ASSERT_LOCK(pVM); 2079 2080 2080 2081 /*
Note:
See TracChangeset
for help on using the changeset viewer.