Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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 11 years ago by charles

  • Status changed from new to assigned

comment:2 Changed 11 years ago by charles

  • Resolution set to fixed
  • Status changed from assigned to closed

Added to trunk by r10916

comment:3 Changed 11 years ago by charles

r10921 fixes a typo that crept into r10916.

comment:4 Changed 11 years ago by charles

  • Milestone changed from 2.10 to 2.02

backported to the 2.0x branch by r10929

comment:5 Changed 11 years ago by charles

  • Keywords backport-2.0x removed
Note: See TracTickets for help on using tickets.