Skip to content

Commit c95b0f4

Browse files
committed
Fix bug in dtm_sleep
1 parent 0075f0f commit c95b0f4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/pg_tsdtm/pg_dtm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ static void dtm_sleep(timestamp_t interval)
118118
#if TRACE_SLEEP_TIME
119119
timestamp_t now = dtm_get_current_time();
120120
#endif
121+
ts.tv_sec = 0;
122+
ts.tv_nsec = interval*1000;
123+
121124
while (nanosleep(&ts, &rem) < 0) {
122125
totalSleepInterrupts += 1;
123126
Assert(errno == EINTR);

0 commit comments

Comments
 (0)