The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #69 from haesbaert/submitwait

Use submit_and_wait where appropriate

authored by

Thomas Leonard and committed by
GitHub
d4e50e39 534ddc23

+4 -6
+4 -6
lib/uring/uring_stubs.c
··· 668 668 CAMLparam2(v_uring, v_timeout); 669 669 double timeout = Double_val(v_timeout); 670 670 struct __kernel_timespec t; 671 - t.tv_sec = (time_t) timeout; 672 - t.tv_nsec = (timeout - t.tv_sec) * 1e9; 673 671 long id; 674 672 struct io_uring *ring = Ring_val(v_uring); 675 673 struct io_uring_cqe *cqe; 676 674 int res; 675 + t.tv_sec = (time_t) timeout; 676 + t.tv_nsec = (timeout - t.tv_sec) * 1e9; 677 677 dprintf("cqe: waiting, timeout %fs\n", timeout); 678 678 caml_enter_blocking_section(); 679 - io_uring_submit(ring); 680 - res = io_uring_wait_cqe_timeout(ring, &cqe, &t); 679 + res = io_uring_submit_and_wait_timeout(ring, &cqe, 1, &t, NULL); 681 680 caml_leave_blocking_section(); 682 681 if (res < 0) { 683 682 if (res == -EAGAIN || res == -EINTR || res == -ETIME) { ··· 701 700 int res; 702 701 dprintf("cqe: waiting\n"); 703 702 caml_enter_blocking_section(); 704 - io_uring_submit(ring); 705 - res = io_uring_wait_cqe(ring, &cqe); 703 + res = io_uring_submit_and_wait_timeout(ring, &cqe, 1, NULL, NULL); 706 704 caml_leave_blocking_section(); 707 705 if (res < 0) { 708 706 if (res == -EAGAIN || res == -EINTR) {