2023-03-12 19:57:20 +01:00
|
|
|
// SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
// author: Max Kellermann <max.kellermann@gmail.com>
|
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());
|
|
|
|
}
|