setup.rs
Contains an unbounded block loopimports std::ffi::c_void
SHA-2564840f88b0c7155037e5adfb12305026fb17c28b404e50f3a521765e843452fe4
MaleculeH(Db₂)Md(In)
Evidence
1// Copyright 2018-2026 the Deno authors. MIT license.
2
3use std::borrow::Cow;
4use std::collections::BinaryHeap;
5use std::collections::HashMap;
6use std::ffi::c_void;
7use std::sync::Mutex;
8use std::sync::Once;
9use std::sync::atomic::AtomicBool;
10use std::sync::atomic::Ordering;
11use std::time::Duration;
12use std::time::Instant;
13
14use futures::task::AtomicWaker;
15
16use super::bindings;
17use super::snapshot;
18use super::snapshot::V8Snapshot;
19
20/// Extract the raw isolate address from an `UnsafeRawIsolatePtr`.
21///
22/// `UnsafeRawIsolateP …
34:23… sized. The compile-time assert above guarantees this.
35 unsafe { std::mem::transmute::<v8::UnsafeRawIsolatePtr, usize>(ptr) }
36}
37
38/// Per-isolate state shared between the V8 platform callback and
39/// the event loop.
40struct IsolateWakeEntry {
⋯4 lines
44:66… wake state.
45/// When V8 posts a foreground task for an isolate, the callback looks up
46/// the state here, sets the notification flag, and wakes the event loop.
47/// Isolates that received a notification before their state was registered
48/// are tracked in `pending_wakes` so …
136:65… ) {
137 let mut heap: BinaryHeap<TimerEntry> = BinaryHeap::new();
138 loop {
139 // Block until either a new entry arrives or the next timer fires.
140 if heap.is_empty() {
141 match rx.recv() {
142 …
318:25… ason. We take a mutex the first time an isolate with a snapshot to
319 // prevent this. https://github.com/denoland/deno/issues/15590
320 if cfg!(wi …