1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Compatibility-only synchronous bridge shim, shared by the outward protocol
//! edges (chio-a2a-edge, chio-acp-edge). The edges gate their use of it on
//! their own `compatibility-surface` feature; the helper itself is always
//! compiled here so both edges can depend on a single definition instead of
//! textually including this file.
//!
//! Mirrors the kernel's sync-bridge gate so the explicit passthrough surface
//! fails closed under a current-thread runtime instead of deadlocking.
/// Sentinel error returned by [`block_on_tool_server_invoke`] when the
/// passthrough is invoked from inside a current-thread Tokio runtime.
/// Mirrors `chio_kernel::KernelError::SyncBridgeIncompatibleWithCurrentThreadRuntime`:
/// polling an async tool-server future with `futures::executor::block_on`
/// on the only worker thread can deadlock indefinitely if the future
/// awaits Tokio I/O. The kernel bridge refuses this case fail-closed,
/// and the edge shims must match instead of reintroducing the
/// deadlock through the `compatibility-surface` feature.
;
/// Mirrors `chio_kernel::kernel::block_on_async_tool_dispatch`: on a
/// multi-thread runtime use `block_in_place` so we yield the runtime;
/// on a current-thread runtime fail-closed with
/// [`SyncBridgeIncompatibleWithCurrentThreadRuntime`] instead of
/// silently parking the only worker thread; with no runtime active,
/// drive the future with the non-tokio `futures::executor::block_on`.