Skip to content

Commit

Permalink
FIXED: Build failure on systems without sem_timedwait()
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWielemaker committed Oct 9, 2024
1 parent 984f58b commit 51dcd3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pl-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,13 +1194,14 @@ exitPrologThreads(void)
{ double grace_time = halt_grace_time();

#ifdef USE_TIMER_WAIT
DEBUG(MSG_CLEANUP_THREAD, Sdprintf("Waiting for %d threads (alarm timer)\n", canceled));
DEBUG(MSG_CLEANUP_THREAD,
Sdprintf("Waiting for %d threads (alarm timer)\n", canceled));
struct itimerval timeout = {0};
struct sigaction act = {0};
double ip, fp=modf(grace_time,&ip);

timeout.it_value.tv_sec = (time_t)ip;
timeout.it_value.tv_nsec = (long)(fp*1000000000.0);
timeout.it_value.tv_usec = (long)(fp*1000000.0);
act.sa_handler = dummy_handler;

if ( sigaction(SIGALRM, &act, NULL) != 0 ||
Expand Down

0 comments on commit 51dcd3f

Please sign in to comment.