io/uring/Operation: add method GetUringData()
This commit is contained in:
parent
0ba0c64093
commit
3f638bfa03
@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Uring {
|
||||
|
||||
class CancellableOperation;
|
||||
@ -33,6 +35,16 @@ public:
|
||||
return cancellable != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data pointer that can be passed to
|
||||
* io_uring_prep_cancel().
|
||||
*/
|
||||
void *GetUringData() const noexcept {
|
||||
assert(IsUringPending());
|
||||
|
||||
return cancellable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the operation. OnUringCompletion() will not be
|
||||
* invoked. This is a no-op if none is pending.
|
||||
|
Loading…
x
Reference in New Issue
Block a user