From 007444c9701f8ed899964ae7c43186a987fdac5a Mon Sep 17 00:00:00 2001 From: deanlee Date: Thu, 4 Jul 2024 13:57:38 +0800 Subject: [PATCH] dd --- msgq/msgq.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/msgq/msgq.cc b/msgq/msgq.cc index edd39031..33f4ee1f 100644 --- a/msgq/msgq.cc +++ b/msgq/msgq.cc @@ -75,26 +75,20 @@ Futex() { } void post() { - printf("begin post\n"); (*event_counter) += 1; (*futex) += 1; futex_wake(&(header->futex), INT_MAX); - printf("posted %d\n", futex->load()); } int wait(int last_event, int timeout_ms) { - printf("begin wait\n"); - struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec = (timeout_ms / 1000); ts.tv_nsec = (timeout_ms % 1000) * 1000000; -printf("wait %d\n", last_event); if ((*futex) == last_event) { int ret = syscall(SYS_futex, &header->futex, FUTEX_WAIT, last_event, &ts, NULL, 0); if (ret == -1 && errno == ETIMEDOUT) { - printf("time out \n"); return -1; // Timeout occurred } } @@ -512,11 +506,9 @@ int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){ int ret = g_futex.wait(last_event, ms); if (ret == -1) { - printf("timeout !!\n"); break; } last_event = g_futex.futex->load(); - printf("%d\n", last_event); // Check if messages ready for (size_t i = 0; i < nitems; i++) { if (items[i].revents == 0 && msgq_msg_ready(items[i].q)){