Skip to content
Snippets Groups Projects
Commit 8c95f8de authored by Florian Fischer's avatar Florian Fischer
Browse files

[Future] assert that a Future is only completed once

parent fde944bf
No related branches found
No related tags found
1 merge request!134Debug changes for our Future
......@@ -6,6 +6,7 @@
#include <sys/socket.h> // for socklen_t
#include <sys/types.h> // for ssize_t
#include <cassert>
#include <cstddef> // for size_t
#include <cstdint> // for int32_t, uint8_t
#include <cstdlib> // for abort
......@@ -93,6 +94,7 @@ class Future : public Logger<LogSubsystem::IO> {
virtual void prepareSqe(io_uring_sqe* sqe) = 0;
void setCompletion(int32_t res) {
assert(!state.completed);
LOGD("Complete " << this);
returnValue = res;
state.completed = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment