#3381 closed Enhancement (fixed)
replace calls to usleep with calls to nanosleep
Reported by: | charles | Owned by: | charles |
---|---|---|---|
Priority: | Normal | Milestone: | 2.02 |
Component: | libtransmission | Version: | 2.01 |
Severity: | Normal | Keywords: | |
Cc: |
Description
(the text of this ticket is cribbed from a similar issue on the Soar project :)
On Windows we use a call to Sleep in various places, and this is fine. On Linux and OS X, we use the system call usleep. The problem with usleep is it isn't POSIX so it isn't a) guaranteed to exist, and b) guaranteed to have the same behavior. For these reasons (and possibly others) it's considered obsolete.
For this reason, we should replace all calls to usleep with calls to nanosleep. This affects tr_wait_msec(). It's a little bit of a pain because nanosleep takes a timespec structure instead of just an int.
Change History (5)
comment:1 Changed 13 years ago by charles
- Status changed from new to assigned
comment:2 Changed 13 years ago by charles
- Resolution set to fixed
- Status changed from assigned to closed
comment:3 Changed 13 years ago by charles
comment:4 Changed 13 years ago by charles
- Milestone changed from 2.10 to 2.02
backported to the 2.0x branch by r10929
comment:5 Changed 13 years ago by charles
- Keywords backport-2.0x removed
Added to trunk by r10916