From f96db2c656055ef8a46fdc4992e5d61ae8a2eff2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 6 Aug 2007 23:06:16 +0000 Subject: [PATCH] svn path=/trunk/boinc/; revision=13270 --- api/graphics_api.C | 14 +++++++++++++- api/graphics_api.h | 2 ++ checkin_notes | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/api/graphics_api.C b/api/graphics_api.C index b883089daa..6a2a404783 100755 --- a/api/graphics_api.C +++ b/api/graphics_api.C @@ -37,7 +37,19 @@ static void init_main_state() { boinc_main_state.set_worker_timer_hook = set_worker_timer; boinc_main_state.app_client_shmp = &app_client_shm; #ifdef _WIN32 - boinc_main_state.gfx_timer_id = NULL; + boinc_main_state.gfx_timer_id = (UINT_PTR)NULL; +#endif +} + +void boinc_suspend_graphics_thread() { +#ifdef _WIN32 + if (graphics_threadh) SuspendThread(graphics_threadh); +#endif +} + +void boinc_resume_graphics_thread() { +#ifdef _WIN32 + if (graphics_threadh) ResumeThread(graphics_threadh); #endif } diff --git a/api/graphics_api.h b/api/graphics_api.h index b00df8dc8b..e809e3353f 100755 --- a/api/graphics_api.h +++ b/api/graphics_api.h @@ -42,6 +42,8 @@ extern void boinc_app_mouse_button(int x, int y, int which, int is_down); extern void boinc_app_mouse_move(int x, int y, int left, int middle, int right); extern void boinc_app_key_press(int, int); extern void boinc_app_key_release(int, int); +extern void boinc_suspend_graphics_thread(); +extern void boinc_resume_graphics_thread(); // C++ API follows here #ifdef __cplusplus diff --git a/checkin_notes b/checkin_notes index 63a7d63862..11afd85b60 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7684,3 +7684,11 @@ Rom 2 Aug 2007 boinc_logo.gif lib/ stackwalker_win.cpp + +Eric K 06 Aug 2007 + -added new functions boinc_suspend_graphics_thread() and + boinc_resume_graphics_thread(), so apps can suspend the graphics + threads for critical sections without suspending all threads. + Only implemented under WIN32 thus far. + api/ + graphics_lib.[Ch]