Changeset 6299
- Timestamp:
- 03/02/07 10:26:55
- Files:
-
- OpenThreads/trunk/pthread_src/PThreadCondition.c++ (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenThreads/trunk/pthread_src/PThreadCondition.c++
r6298 r6299 151 151 static_cast<PThreadMutexPrivateData *>(mutex->_prvData); 152 152 153 154 // wait time is now in ms milliseconds, so need to convert to seconds and nanoseconds for timespec strucuture. 155 unsigned int sec = ms / 1000; 156 unsigned int nsec = (ms % 1000) * 1000000; 157 158 // add to the current time 153 159 struct ::timeval now; 154 160 ::gettimeofday( &now, 0 ); 155 161 156 // Wait time is now + ms milliseconds 157 unsigned int sec = ms / 1000; 158 unsigned int nsec = (ms % 1000) * 1000000; 162 sec += now.tv_sec; 163 nsec += now.tv_usec*1000; 164 165 // now pass on any overflow from nsec onto seconds. 166 sec += nsec / 1000000000; 167 nsec = nsec % 1000000000; 159 168 160 169 struct timespec abstime; 161 abstime.tv_sec = now.tv_sec +sec;162 abstime.tv_nsec = n ow.tv_usec*1000 + nsec;170 abstime.tv_sec = sec; 171 abstime.tv_nsec = nsec; 163 172 164 173 int status;
