Skip to content

Commit

Permalink
Fix build and sleep better
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Dec 23, 2017
1 parent 19a1e78 commit 380fd3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libknet/threads_pmtud.c
Expand Up @@ -427,7 +427,11 @@ void *_handle_pmtud_link_thread(void *data)
knet_h->pmtudbuf->kh_node = htons(knet_h->host_id);

while (!shutdown_in_progress(knet_h)) {
sleep(knet_h->pmtud_interval);
if (first_run) {
sleep(KNET_PMTUD_DEFAULT_INTERVAL);
} else {
usleep(KNET_THREADS_TIMERES);
}

if (pthread_mutex_lock(&knet_h->pmtud_mutex) != 0) {
log_debug(knet_h, KNET_SUB_PMTUD, "Unable to get mutex lock");
Expand Down Expand Up @@ -483,7 +487,7 @@ void *_handle_pmtud_link_thread(void *data)
first_run = 0;
if (pthread_rwlock_rdlock(&knet_h->global_rwlock) != 0) {
log_debug(knet_h, KNET_SUB_PMTUD, "Unable to get read lock");
got out_unlock;
goto out_unlock;
}
knet_h->pmtud_firstrun = first_run;
pthread_mutex_unlock(&knet_h->pmtud_mutex);
Expand Down

0 comments on commit 380fd3f

Please sign in to comment.