From: Andre Noll Date: Sun, 14 Dec 2014 20:47:37 +0000 (+0100) Subject: Merge branch 'refs/heads/t/kill_usleep' X-Git-Tag: v0.5.4~44 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d1e7875caba9aface190dab0de394435a80edd21;hp=5694a4de6a378a882c14e176bfaec1d325ebe130 Merge branch 'refs/heads/t/kill_usleep' --- diff --git a/command.c b/command.c index 80584510..551fe05a 100644 --- a/command.c +++ b/command.c @@ -363,8 +363,10 @@ static int com_sender(struct command_context *cc) for (i = 0; i < 10; i++) { mutex_lock(mmd_mutex); if (mmd->sender_cmd_data.cmd_num >= 0) { + /* another sender command is active, retry in 100ms */ + struct timespec ts = {.tv_nsec = 100 * 1000 * 1000}; mutex_unlock(mmd_mutex); - usleep(100 * 1000); + nanosleep(&ts, NULL); continue; } mmd->sender_cmd_data = scd;