forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSCTaskScheduler.h
More file actions
25 lines (19 loc) · 775 Bytes
/
Copy pathJSCTaskScheduler.h
File metadata and controls
25 lines (19 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
#include <JavaScriptCore/DeferredWorkTimer.h>
namespace Bun {
class JSCTaskScheduler {
public:
JSCTaskScheduler()
: m_pendingTicketsKeepingEventLoopAlive()
, m_pendingTicketsOther()
{
}
static void onAddPendingWork(std::unique_ptr<JSC::DeferredWorkTimer::TicketData> ticket, JSC::DeferredWorkTimer::WorkKind kind);
static void onScheduleWorkSoon(JSC::DeferredWorkTimer::Ticket ticket, JSC::DeferredWorkTimer::Task&& task);
static void onCancelPendingWork(JSC::DeferredWorkTimer::Ticket ticket);
public:
Lock m_lock;
HashSet<std::unique_ptr<JSC::DeferredWorkTimer::TicketData>> m_pendingTicketsKeepingEventLoopAlive;
HashSet<std::unique_ptr<JSC::DeferredWorkTimer::TicketData>> m_pendingTicketsOther;
};
}