Cleanup mbgl/actor/mailbox* implementation for repetition in ensuring valid weakScheduler exists before usage (#2733)

This commit is contained in:
bilal614
2024-08-26 16:56:07 +03:00
committed by GitHub
parent 30f3e416f0
commit cf55873cf9
2 changed files with 22 additions and 29 deletions

View File

@@ -3,6 +3,7 @@
#include <functional>
#include <memory>
#include <mutex>
#include <optional>
#include <queue>
#include <mapbox/std/weak.hpp>
@@ -39,10 +40,8 @@ public:
void push(std::unique_ptr<Message>);
void receive();
static void maybeReceive(const std::weak_ptr<Mailbox>&);
static std::function<void()> makeClosure(std::weak_ptr<Mailbox>);
private:
void scheduleToRecieve(const std::optional<util::SimpleIdentity>& tag = std::nullopt);
enum class State : uint32_t {
Idle = 0,
Processing,