Definition at line 558 of file isolate.cc.
◆ SpawnIsolateTask()
Definition at line 560 of file isolate.cc.
562 : parent_isolate_(parent_isolate), state_(std::move(
state)) {
563 parent_isolate->IncrementSpawnCount();
564 }
◆ ~SpawnIsolateTask()
dart::SpawnIsolateTask::~SpawnIsolateTask |
( |
| ) |
|
|
inlineoverride |
Definition at line 566 of file isolate.cc.
566 {
567 if (parent_isolate_ != nullptr) {
569 }
570 }
void DecrementSpawnCount()
◆ Run()
void dart::SpawnIsolateTask::Run |
( |
| ) |
|
|
inlineoverridevirtual |
Implements dart::ThreadPool::Task.
Definition at line 572 of file isolate.cc.
572 {
573 const char*
name = state_->debug_name();
575
576 auto group = state_->isolate_group();
577 if (
group ==
nullptr) {
579 } else {
581 }
582 }
void RunLightweight(const char *name)
void RunHeavyweight(const char *name)
◆ RunHeavyweight()
void dart::SpawnIsolateTask::RunHeavyweight |
( |
const char * |
name | ) |
|
|
inline |
Definition at line 584 of file isolate.cc.
584 {
585
586
588 if (create_group_callback == nullptr) {
589 FailedSpawn("Isolate spawn is not supported by this Dart embedder\n");
590 return;
591 }
592
593 char*
error =
nullptr;
594
595
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611 const bool is_parent_main_isolate =
612 strcmp(parent_isolate_->
name(),
"main") == 0;
616 (create_group_callback)(state_->script_url(),
name,
nullptr,
617 state_->package_config(), &api_flags,
620 parent_isolate_ = nullptr;
621
622 if (isolate == nullptr) {
623 FailedSpawn(
error,
false);
625 return;
626 }
628 Run(
reinterpret_cast<Isolate*
>(isolate));
629 }
void * init_callback_data() const
static Dart_IsolateGroupCreateCallback CreateGroupCallback()
const char * name() const
struct _Dart_Isolate * Dart_Isolate
const uint8_t uint32_t uint32_t GError ** error
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate)
◆ RunLightweight()
void dart::SpawnIsolateTask::RunLightweight |
( |
const char * |
name | ) |
|
|
inline |
Definition at line 631 of file isolate.cc.
631 {
632
634 if (initialize_callback == nullptr) {
635 FailedSpawn(
636 "Lightweight isolate spawn is not supported by this Dart embedder\n",
637 false);
638 return;
639 }
640
641 char*
error =
nullptr;
642
643 auto group = state_->isolate_group();
646 parent_isolate_ = nullptr;
647
648 if (isolate == nullptr) {
649 FailedSpawn(
error,
false);
651 return;
652 }
653
654 void* child_isolate_data = nullptr;
655 const bool success = initialize_callback(&child_isolate_data, &
error);
656 if (!success) {
660 return;
661 }
662
663 isolate->set_init_callback_data(child_isolate_data);
665 }
static Dart_InitializeIsolateCallback InitializeCallback()
Isolate * CreateWithinExistingIsolateGroup(IsolateGroup *group, const char *name, char **error)
DART_EXPORT void Dart_ShutdownIsolate()
The documentation for this class was generated from the following file: