Back to the main page.

Bug 163 - using sleep in a thread causes the whole process to sleep

Reported 2010-09-21 09:31:00 +0200
Modified 2011-01-05 12:01:05 +0100
Product: FieldTrip
Component: peer
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Robert Oostenveld
Depends on:
See also:

Robert Oostenveld - 2010-09-21 09:31:31 +0200

to sleep a thread instead of entire process you have to use int nanosleep(const struct timespec *req, struct timespec *rem). You need to pass struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; as arguments. req will tell the function how much time is required to sleep for. While sleeping some signal may appear. In that case rem will contain how much time still remains to be slept for. You can use time to sleep again for the remaining time duration.

Robert Oostenveld - 2010-10-05 21:52:25 +0200

fixed in revision 1835

Robert Oostenveld - 2011-01-05 11:57:00 +0100

selected a long list of resolved bugs from roboos and changed the status into "RESOLVED"

Robert Oostenveld - 2011-01-05 12:01:05 +0100

selected all old bugs from roboos with status RESOLVED and changed it into CLOSED