From c972c9185a8d7a682d1d86b4209c0f4347590f08 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Thu, 7 Nov 2002 18:52:47 +0000 Subject: [PATCH] OS X fixes svn path=/trunk/boinc/; revision=581 --- api/boinc_api.C | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index bb2fd1adb3..cde6cf5ed7 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -252,6 +252,7 @@ int boinc_resolve_filename(char *virtual_name, char *physical_name, int len) { bool boinc_time_to_checkpoint() { // Tell the graphics thread it's OK to draw now +#ifdef BOINC_APP_GRAPHICS if (ready_to_redraw) { ok_to_draw = 1; // And wait for the graphics thread to notify us that it's done drawing @@ -262,17 +263,18 @@ bool boinc_time_to_checkpoint() { // possibility of deadlock (which was happening with an infinite wait value) WaitForSingleObject( hGlobalDrawEvent, 10 ); } -#endif +#endif _WIN32 #ifdef __APPLE_CC__ while (ok_to_draw) { MPWaitOnQueue( drawQueue, NULL, NULL, NULL, kDurationImmediate ); YieldToAnyThread(); } -#endif +#endif // __APPLE_CC__ // Reset the refresh counter time_until_redraw = gi.refresh_period; ready_to_redraw = false; } +#endif // BOINC_APP_GRAPHICS return ready_to_checkpoint; } @@ -391,7 +393,8 @@ void on_timer(int a) { } } -#ifdef __APPLE_CC__ +#if defined __APPLE_CC__ && defined BOINC_APP_GRAPHICS + // Yield to the graphics thread to let it draw if needed YieldToAnyThread(); #endif } @@ -419,7 +422,7 @@ int set_timer(double period) { NULL); // object not named #endif -#ifdef __APPLE_CC__ +#if defined BOINC_APP_GRAPHICS && defined __APPLE_CC__ // Create notification queue for drawing MPCreateQueue( &drawQueue ); #endif