Use Win32 runtime binding for thread control

This commit is contained in:
2026-06-17 11:41:51 +02:00
parent 9602196e99
commit a1031b3af1
4 changed files with 18 additions and 4 deletions

View File

@@ -70,6 +70,10 @@ What is already real:
- `pp_app_core`
Latest slice:
- `src/platform_windows/windows_runtime_shell.cpp` and
`src/platform_windows/windows_lifecycle_shell.cpp` now drive thread
start/stop through the explicit Windows runtime binding instead of routing
that control through `App::runtime()`.
- `src/platform_windows/windows_platform_services.cpp` no longer brokers the
Win32 main-thread queue through `bound_app()->runtime()`; it now uses an
explicit Windows runtime binding.

View File

@@ -78,6 +78,9 @@ Completed, blocked, and superseded task history moved to
the queue is now ordered by code movement instead.
Current slice:
- `src/platform_windows/windows_runtime_shell.cpp` and
`src/platform_windows/windows_lifecycle_shell.cpp` now use the explicit
Windows runtime binding for thread start/stop control.
- `src/platform_windows/windows_platform_services.cpp` no longer uses
`bound_app()->runtime()` for main-thread task brokering.
- `src/platform_windows/windows_runtime_state.*` now carries the active

View File

@@ -7,6 +7,7 @@
#include "platform_windows/windows_lifecycle_state.h"
#include "platform_windows/windows_main_window_session.h"
#include "platform_windows/windows_runtime_shell.h"
#include "platform_windows/windows_runtime_state.h"
#include "platform_windows/windows_stylus_input.h"
namespace pp::platform::windows {
@@ -19,10 +20,14 @@ void request_window_close(HWND hWnd)
void handle_window_close_message(VrShellState& vr)
{
auto* app = bound_app();
auto* runtime = retained_bound_runtime();
mark_lifecycle_stopped();
request_stop_and_join_vr_thread(vr);
app->runtime().ui_thread_stop();
app->runtime().render_thread_stop();
if (runtime)
{
runtime->ui_thread_stop();
runtime->render_thread_stop();
}
app->terminate();
release_bound_app();
PostQuitMessage(0);

View File

@@ -30,9 +30,11 @@ void register_touch_window(HWND hWnd)
void initialize_runtime_threads()
{
auto* app = bound_app();
auto* runtime = retained_bound_runtime();
assert(runtime);
mark_lifecycle_running();
app->runtime().render_thread_start(*app);
app->runtime().ui_thread_start(*app);
runtime->render_thread_start(*app);
runtime->ui_thread_start(*app);
}
void install_debug_gl_callbacks()