Skip to content

Commit

Permalink
Only wait when necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkent authored and jeremy committed Oct 11, 2024
1 parent 355af02 commit 4d21dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/rbtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ rbtrace__receive(void *data)
// wait up to a second for the message to arrive
for (n=0; n<10 && ret==-1; n++) {
ret = msgrcv(rbtracer.mqi_id, &msg, sizeof(msg)-sizeof(long), 0, IPC_NOWAIT);
nanosleep((const struct timespec[]){{0, (100 % 1000) * 1000000}}, NULL); // 100ms
if (ret == -1) nanosleep((const struct timespec[]){{0, (100 % 1000) * 1000000}}, NULL); // 100ms
}

if (ret == -1) {
Expand Down

0 comments on commit 4d21dbe

Please sign in to comment.