Files
sdk/runtime/lib/schedule_microtask_patch.dart
T
Ben Konyi 08f59e5de3 These changes are causing a segfault in DartEntry::InvokeFunction in dart_entry.cc in Flutter,
which was blocking the Dart SDK roll.

Revert "Take 3 for "[vm/kernel/precomp] Remove procedures from entry points files.""

This reverts commit 567109df7f.

Revert "[vm/precomp] Extend @pragma entry-points to classes."

This reverts commit 232698047c.

Change-Id: Ib63d1afb8a1c978be7ddf282af0e7d5547111cc3
Reviewed-on: https://dart-review.googlesource.com/67300
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-07-28 00:01:50 +00:00

31 lines
841 B
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// part of "async_patch.dart";
@patch
class _AsyncRun {
@patch
static void _scheduleImmediate(void callback()) {
if (_ScheduleImmediate._closure == null) {
throw new UnsupportedError("Microtasks are not supported");
}
_ScheduleImmediate._closure(callback);
}
}
typedef void _ScheduleImmediateClosure(void callback());
class _ScheduleImmediate {
static _ScheduleImmediateClosure _closure;
}
void _setScheduleImmediateClosure(_ScheduleImmediateClosure closure) {
_ScheduleImmediate._closure = closure;
}
void _ensureScheduleImmediate() {
_AsyncRun._scheduleImmediate(_startMicrotaskLoop);
}