=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/win/Attic/wpause.c,v retrieving revision 1.1 retrieving revision 1.1.1.3 diff -u -p -r1.1 -r1.1.1.3 --- OpenXM_contrib/gnuplot/win/Attic/wpause.c 2000/01/09 17:01:19 1.1 +++ OpenXM_contrib/gnuplot/win/Attic/wpause.c 2003/09/15 07:09:40 1.1.1.3 @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid = "$Id: wpause.c,v 1.1 2000/01/09 17:01:19 maekawa Exp $"; +static char *RCSid = "$Id: wpause.c,v 1.1.1.3 2003/09/15 07:09:40 ohara Exp $"; #endif /* GNUPLOT - win/wpause.c */ @@ -132,12 +132,16 @@ PauseBox(LPPW lppw) lppw->bPause = TRUE; lppw->bPauseCancel = IDCANCEL; - while (lppw->bPause) - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { + while (lppw->bPause) { + /* HBB 20021211: Nigel Nunn found a better way to avoid + * 100% CPU load --> use it */ + if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { /* wait until window closed */ - TranslateMessage(&msg); - DispatchMessage(&msg); - } + TranslateMessage(&msg); + DispatchMessage(&msg); + } else + WaitMessage(); + } DestroyWindow(lppw->hWndPause); #ifndef WIN32 #ifndef __DLL__