Safe stop procedure

This commit is contained in:
Vitaliy Filippov
2019-11-25 01:29:07 +03:00
parent 50cf3667fa
commit be3015169f
5 changed files with 37 additions and 3 deletions
+5 -1
View File
@@ -271,6 +271,8 @@ class blockstore
ring_loop_t *ringloop;
bool stop_sync_submitted;
inline struct io_uring_sqe* get_sqe()
{
return ringloop->get_sqe();
@@ -327,12 +329,14 @@ public:
// Event loop
void loop();
// Returns true when blockstore is ready to process operations
// (Although you're free to enqueue them before that)
bool is_started();
// Returns true when it's safe to destroy the instance. If destroying the instance
// requires to purge some queues, starts that process. Should be called in the event
// loop until it returns true.
bool stop();
bool is_safe_to_stop();
// Submission
void enqueue_op(blockstore_operation *op);