Skip to content

Commit e1d53e6

Browse files
committed
fix: timeout cancellation
1 parent 882a527 commit e1d53e6

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/io_service.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <cassert>
1111
#include <algorithm>
1212
#include <thread>
13+
#include <vector>
1314

1415
#if CPPCORO_OS_WINNT
1516
# ifndef WIN32_LEAN_AND_MEAN
@@ -998,8 +999,7 @@ cppcoro::io_service::timed_schedule_operation::timed_schedule_operation(
998999
{
9991000
#if CPPCORO_OS_LINUX
10001001
m_cancellationRegistration.emplace(std::move(m_cancellationToken), [&service, this] {
1001-
m_message.result = -ECANCELED;
1002-
service.io_queue().transaction(m_message).timeout_remove().nop().commit();
1002+
service.io_queue().transaction(m_message).timeout_remove().commit();
10031003
});
10041004
#endif
10051005
}

lib/linux_uring_queue.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ namespace cppcoro::detail::lnx {
118118

119119
io_transaction &io_transaction::timeout_remove(int flags) noexcept {
120120
if (m_sqe) {
121-
io_uring_prep_timeout_remove(m_sqe, *reinterpret_cast<uint64_t*>(&m_message), flags);
122-
m_message.result = -ECANCELED;
121+
io_uring_prep_timeout_remove(m_sqe, reinterpret_cast<uint64_t>(&m_message), flags);
123122
}
124123
return *this;
125124
}

0 commit comments

Comments
 (0)