2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2013-08-07 18:59:42 +02:00
|
|
|
|
2017-11-12 17:34:06 +01:00
|
|
|
#include "DeferEvent.hxx"
|
2013-08-07 18:59:42 +02:00
|
|
|
#include "Loop.hxx"
|
|
|
|
|
|
|
|
void
|
2017-11-12 17:34:06 +01:00
|
|
|
DeferEvent::Schedule() noexcept
|
2013-08-07 18:59:42 +02:00
|
|
|
{
|
2020-12-01 16:56:58 +01:00
|
|
|
if (!IsPending())
|
2020-12-01 17:26:39 +01:00
|
|
|
loop.AddDefer(*this);
|
2020-12-01 16:56:58 +01:00
|
|
|
|
|
|
|
assert(IsPending());
|
2013-08-07 18:59:42 +02:00
|
|
|
}
|
2020-12-01 17:04:14 +01:00
|
|
|
|
|
|
|
void
|
|
|
|
DeferEvent::ScheduleIdle() noexcept
|
|
|
|
{
|
|
|
|
if (!IsPending())
|
|
|
|
loop.AddIdle(*this);
|
|
|
|
|
|
|
|
assert(IsPending());
|
|
|
|
}
|