Skip to content

Commit ac2aba0

Browse files
committed
Threading: fix timeout calcuation
1 parent d0ca944 commit ac2aba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/thread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
struct timespec ts;
6666
if (clock_gettime(CLOCK_REALTIME, &ts) == 0)
6767
{
68-
ts.tv_sec += ts.tv_sec / 1000;
69-
ts.tv_nsec += (ts.tv_nsec % 1000) * 1000000;
68+
ts.tv_sec += timeout / 1000;
69+
ts.tv_nsec += (timeout % 1000) * 1000000;
7070
if (pthread_timedjoin_np(thread, NULL, &ts) != 0)
7171
{
7272
pthread_kill(thread, SIGTERM);

0 commit comments

Comments
 (0)