Changeset 22957 in vbox
- Timestamp:
- Sep 11, 2009 1:04:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
r8651 r22957 173 173 struct timespec ts; 174 174 struct timespec *pTimeout = NULL; 175 uint64_t u64End = 0; /* shut up gcc */ 175 176 if (cMillies != RT_INDEFINITE_WAIT) 176 177 { 177 178 ts.tv_sec = cMillies / 1000; 178 179 ts.tv_nsec = (cMillies % 1000) * 1000000; 180 u64End = RTTimeSystemNanoTS() + cMillies * 1000000; 179 181 pTimeout = &ts; 180 182 } … … 226 228 return RTErrConvertFromErrno(rc); 227 229 } 230 231 /* adjust the relative timeout */ 232 if (pTimeout) 233 { 234 int64_t u64Diff = u64End - RTTimeSystemNanoTS(); 235 if (u64Diff < 1000) 236 { 237 rc = VERR_TIMEOUT; 238 break; 239 } 240 ts.tv_sec = u64Diff / 1000000000; 241 ts.tv_nsec = u64Diff % 1000000000; 242 } 228 243 } 229 244
Note:
See TracChangeset
for help on using the changeset viewer.