mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-09 21:36:48 +00:00
Wake up background polling thread when old_instant is 0
Co-authored-by: Ruihan Li <lrh2000@pku.edu.cn>
This commit is contained in:
parent
328ce9e92c
commit
3981cd63cd
@ -177,7 +177,7 @@ impl IfaceCommon {
|
|||||||
let new_instant = instant.total_millis() as u64;
|
let new_instant = instant.total_millis() as u64;
|
||||||
self.next_poll_at_ms.store(new_instant, Ordering::Relaxed);
|
self.next_poll_at_ms.store(new_instant, Ordering::Relaxed);
|
||||||
|
|
||||||
if new_instant < old_instant {
|
if old_instant == 0 || new_instant < old_instant {
|
||||||
self.polling_wait_queue.wake_all();
|
self.polling_wait_queue.wake_all();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -338,26 +338,23 @@ FN_TEST(sendmsg_and_recvmsg)
|
|||||||
|
|
||||||
// Send two message and receive two message
|
// Send two message and receive two message
|
||||||
|
|
||||||
// This test is commented out due to a known issue:
|
iov[0].iov_base = message;
|
||||||
// See <https://github.com/asterinas/asterinas/issues/819>
|
iov[0].iov_len = strlen(message);
|
||||||
|
msg.msg_iovlen = 1;
|
||||||
|
TEST_RES(sendmsg(sk_accepted, &msg, 0), _ret == strlen(message));
|
||||||
|
TEST_RES(sendmsg(sk_accepted, &msg, 0), _ret == strlen(message));
|
||||||
|
|
||||||
// iov[0].iov_base = message;
|
char first_buffer[BUFFER_SIZE] = { 0 };
|
||||||
// iov[0].iov_len = strlen(message);
|
char second_buffer[BUFFER_SIZE] = { 0 };
|
||||||
// msg.msg_iovlen = 1;
|
iov[0].iov_base = first_buffer;
|
||||||
// TEST_RES(sendmsg(sk_accepted, &msg, 0), _ret == strlen(message));
|
iov[0].iov_len = BUFFER_SIZE;
|
||||||
// TEST_RES(sendmsg(sk_accepted, &msg, 0), _ret == strlen(message));
|
iov[1].iov_base = second_buffer;
|
||||||
|
iov[1].iov_len = BUFFER_SIZE;
|
||||||
|
msg.msg_iovlen = 2;
|
||||||
|
|
||||||
// char first_buffer[BUFFER_SIZE] = { 0 };
|
// Ensure two messages are prepared for receiving
|
||||||
// char second_buffer[BUFFER_SIZE] = { 0 };
|
sleep(1);
|
||||||
// iov[0].iov_base = first_buffer;
|
|
||||||
// iov[0].iov_len = BUFFER_SIZE;
|
|
||||||
// iov[1].iov_base = second_buffer;
|
|
||||||
// iov[1].iov_len = BUFFER_SIZE;
|
|
||||||
// msg.msg_iovlen = 2;
|
|
||||||
|
|
||||||
// // Ensure two messages are prepared for receiving
|
TEST_RES(recvmsg(sk_connected, &msg, 0), _ret == strlen(message) * 2);
|
||||||
// sleep(1);
|
|
||||||
|
|
||||||
// TEST_RES(recvmsg(sk_connected, &msg, 0), _ret == strlen(message) * 2);
|
|
||||||
}
|
}
|
||||||
END_TEST()
|
END_TEST()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user