Definition at line 559 of file isolate.cc.
◆ SpawnIsolateTask()
Definition at line 561 of file isolate.cc.
563 : parent_isolate_(parent_isolate), state_(std::move(
state)) {
564 parent_isolate->IncrementSpawnCount();
565 }
◆ ~SpawnIsolateTask()
dart::SpawnIsolateTask::~SpawnIsolateTask |
( |
| ) |
|
|
inlineoverride |
Definition at line 567 of file isolate.cc.
567 {
568 if (parent_isolate_ != nullptr) {
570 }
571 }
void DecrementSpawnCount()
◆ Run()
void dart::SpawnIsolateTask::Run |
( |
| ) |
|
|
inlineoverridevirtual |
Implements dart::ThreadPool::Task.
Definition at line 573 of file isolate.cc.
573 {
574 const char*
name = state_->debug_name();
576
577 auto group = state_->isolate_group();
578 if (group == nullptr) {
580 } else {
582 }
583 }
void RunLightweight(const char *name)
void RunHeavyweight(const char *name)
◆ RunHeavyweight()
void dart::SpawnIsolateTask::RunHeavyweight |
( |
const char * |
name | ) |
|
|
inline |
Definition at line 585 of file isolate.cc.
585 {
586
587
589 if (create_group_callback == nullptr) {
590 FailedSpawn("Isolate spawn is not supported by this Dart embedder\n");
591 return;
592 }
593
594 char*
error =
nullptr;
595
596
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612 const bool is_parent_main_isolate =
613 strcmp(parent_isolate_->
name(),
"main") == 0;
617 (create_group_callback)(state_->script_url(),
name,
nullptr,
618 state_->package_config(), &api_flags,
621 parent_isolate_ = nullptr;
622
623 if (isolate == nullptr) {
624 FailedSpawn(
error,
false);
626 return;
627 }
629 Run(
reinterpret_cast<Isolate*
>(isolate));
630 }
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 632 of file isolate.cc.
632 {
633
635 if (initialize_callback == nullptr) {
636 FailedSpawn(
637 "Lightweight isolate spawn is not supported by this Dart embedder\n",
638 false);
639 return;
640 }
641
642 char*
error =
nullptr;
643
644 auto group = state_->isolate_group();
647 parent_isolate_ = nullptr;
648
649 if (isolate == nullptr) {
650 FailedSpawn(
error,
false);
652 return;
653 }
654
655 void* child_isolate_data = nullptr;
656 const bool success = initialize_callback(&child_isolate_data, &
error);
657 if (!success) {
661 return;
662 }
663
664 isolate->set_init_callback_data(child_isolate_data);
666 }
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: