Skip to content

Commit

Permalink
Fixed Helgrind false positives in sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Dec 24, 2017
1 parent 0703a3c commit 53155be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/b6b_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <math.h>
#include <stdlib.h>
#include <sys/syscall.h>
#ifdef B6B_HAVE_VALGRIND
# include <valgrind/helgrind.h>
#endif

#include <b6b.h>

Expand All @@ -47,6 +50,10 @@ static enum b6b_res b6b_time_proc_sleep(struct b6b_interp *interp,
req.tv_sec = (time_t)floor(f->f);
req.tv_nsec = labs((long)(1000000000 * (f->f - (b6b_float)req.tv_sec)));

#ifdef B6B_HAVE_VALGRIND
VALGRIND_HG_DISABLE_CHECKING(&rem, sizeof(rem));
#endif

do {
if (!b6b_syscall(interp, &ret, __NR_nanosleep, &req, &rem))
return B6B_ERR;
Expand Down

0 comments on commit 53155be

Please sign in to comment.