mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06: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;
|
||||
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();
|
||||
}
|
||||
} else {
|
||||
|
@ -338,26 +338,23 @@ FN_TEST(sendmsg_and_recvmsg)
|
||||
|
||||
// Send two message and receive two message
|
||||
|
||||
// This test is commented out due to a known issue:
|
||||
// See <https://github.com/asterinas/asterinas/issues/819>
|
||||
iov[0].iov_base = message;
|
||||
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;
|
||||
// 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));
|
||||
char first_buffer[BUFFER_SIZE] = { 0 };
|
||||
char second_buffer[BUFFER_SIZE] = { 0 };
|
||||
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;
|
||||
|
||||
// char first_buffer[BUFFER_SIZE] = { 0 };
|
||||
// char second_buffer[BUFFER_SIZE] = { 0 };
|
||||
// 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
|
||||
sleep(1);
|
||||
|
||||
// // Ensure two messages are prepared for receiving
|
||||
// sleep(1);
|
||||
|
||||
// TEST_RES(recvmsg(sk_connected, &msg, 0), _ret == strlen(message) * 2);
|
||||
TEST_RES(recvmsg(sk_connected, &msg, 0), _ret == strlen(message) * 2);
|
||||
}
|
||||
END_TEST()
|
||||
|
Loading…
x
Reference in New Issue
Block a user