[core] Introduce Pass<> class and use it for Scheduler

Thus we enforce client to retain the returned `Scheduler` objects.
This commit is contained in:
Mikhail Pozdnyakov
2019-12-02 10:40:59 +02:00
parent e373d8a592
commit 7bacf5696c
5 changed files with 32 additions and 14 deletions

View File

@@ -156,7 +156,7 @@ TEST(Actor, DestructionAllowedInReceiveOnSameThread) {
};
std::promise<void> callbackFiredPromise;
auto retainer = Scheduler::GetBackground();
std::shared_ptr<Scheduler> retainer = Scheduler::GetBackground();
auto test = std::make_unique<Actor<Test>>(retainer);
// Callback (triggered while mutex is locked in Mailbox::receive())