Changeset 19972 in vbox
- Timestamp:
- May 24, 2009 4:54:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
r19565 r19972 163 163 * Translate milliseconds into ticks and go to sleep. 164 164 */ 165 int cTicks; 165 struct timeval tv; 166 166 167 if (cMillies != RT_INDEFINITE_WAIT) 167 168 { 168 if (hz == 1000) 169 cTicks = cMillies; 170 else if (hz == 100) 171 cTicks = cMillies / 10; 172 else 173 { 174 int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000; 175 cTicks = (int)cTicks64; 176 if (cTicks != cTicks64) 177 cTicks = INT_MAX; 178 } 169 tv.tv_sec = cMillies / 1000; 170 tv.tv_usec = (cMillies % 1000) * 1000; 179 171 } 180 172 else 181 cTicks = 0; 173 { 174 tv.tv_sec = 0; 175 tv.tv_usec = 0; 176 } 182 177 183 178 ASMAtomicIncU32(&pEventInt->cWaiters); 184 179 185 rc = msleep_spin(pEventInt, /* block id */ 186 &pEventInt->Mtx, 187 //fInterruptible ? PZERO | PCATCH : PZERO, 188 "iprte", /* max 6 chars */ 189 cTicks); 180 mtx_unlock_spin(&pEventInt->Mtx); 181 rc = tsleep(pEventInt, /* block id */ 182 fInterruptible ? PZERO | PCATCH : PZERO, 183 "iprtev", 184 tvtohz(&tv)); 185 mtx_lock_spin(&pEventInt->Mtx); 186 190 187 switch (rc) 191 188 {
Note:
See TracChangeset
for help on using the changeset viewer.