Commit 701bffe
committed
refactor: delete the managed application runner
`proton_app_run` existed because AppKit insists on owning the macOS main
thread. It took that thread, ran the platform UI loop plus CEF's native
message loop there, and pushed the MoonBit application onto a worker
pthread -- which meant every engine call had to marshal back, and the
engine grew a second identity: a "managed" mode with its own runtime
destroy protocol, its own shutdown handshake, and its own set of APIs
that returned PROTON_ERR_UNSUPPORTED because the runner owned the loop.
The host loop makes all of that unnecessary. MoonBit's async main now
runs on the main thread and `proton_host_loop_poll` advances AppKit and
CEF from inside it, so nothing has to cross a thread boundary and every
runtime API works in one mode only. Nothing has called `proton_app_run`
since the facade stopped using it.
What goes with it on macOS:
- the PROTON_ENGINE_{RETURN,RETURN_U64,RUN}_ON_MAIN macros and their 44
call sites, plus dialog.m's own copy and notification.m's three
hand-written equivalents. proton.c's owner-thread check on every
handle is now the only guard, which is what it was always for.
- the managed destroy path: begin/finish_managed_runtime_destroy,
complete_managed_shutdown_if_ready, and the condition variable the
worker thread blocked on. runtime_destroy is a plain function again.
- proton_engine_{prepare,run_app_loop,quit_app_loop,finish}_app, which
only the runner called, and g_proton_app_terminating, which only
finish_app cleared and nothing ever read.
- `external_message_pump`, previously off under the runner, is now
unconditional -- there is no other way to drive CEF.
The `managed_app_runner` feature string and `@native.run_app` go too.
proton_smoke's app-entry test and the runtime-info assertion in
native_wbtest now assert the removal instead of the behaviour, matching
how proton_exports_smoke already tracks retired exports.
The Linux and Windows engines still reference the runner; their sweep
follows. Neither can be compiled here, so it is kept separate.1 parent 02ae40e commit 701bffe
21 files changed
Lines changed: 48 additions & 2166 deletions
File tree
- native
- include
- src
- engine
- cef_mac
- tests
- proton/native
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | | - | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
70 | | - | |
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
62 | 55 | | |
63 | 56 | | |
64 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
95 | | - | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
| |||
This file was deleted.
0 commit comments