21pthread_key_t g_queue_key;
22pthread_once_t g_queue_key_once = PTHREAD_ONCE_INIT;
25 pthread_key_create(&g_queue_key,
nullptr);
28void SetQueue(DartMicrotaskQueue*
queue) {
29 pthread_once(&g_queue_key_once, MakeKey);
30 pthread_setspecific(g_queue_key,
queue);
33DartMicrotaskQueue* GetQueue() {
35 pthread_getspecific(g_queue_key));
40thread_local DartMicrotaskQueue* g_queue =
nullptr;
42void SetQueue(DartMicrotaskQueue*
queue) {
46DartMicrotaskQueue* GetQueue() {
71 while (!queue_.empty()) {
75 if (
auto dart_state =
callback.dart_state().lock()) {
89 dart_state->MessageEpilogue(
result);
void swap(sk_sp< T > &a, sk_sp< T > &b)
void ScheduleMicrotask(Dart_Handle callback)
static DartMicrotaskQueue * GetForCurrentThread()
static void StartForCurrentThread()
DartErrorHandleType GetLastError()
static DartState * Current()
struct _Dart_Handle * Dart_Handle
DART_EXPORT bool Dart_IsFatalError(Dart_Handle handle)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate(void)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
DartErrorHandleType GetErrorHandleType(Dart_Handle handle)
bool CheckAndHandleError(Dart_Handle handle)