* pinfo.cc (_pinfo::commune_send): Set priority low when sleeping, waiting for
commune completion so that we don't spin waiting for lower priority processes.
This commit is contained in:
parent
73f7245be2
commit
d263732238
|
@ -1,3 +1,9 @@
|
|||
2002-11-04 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* pinfo.cc (_pinfo::commune_send): Set priority low when sleeping,
|
||||
waiting for commune completion so that we don't spin waiting for lower
|
||||
priority processes.
|
||||
|
||||
2002-11-04 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* sigproc.cc (WAIT_SIG_PRIORITY): Bump to THREAD_PRIORITY_TIME_CRITICAL.
|
||||
|
|
|
@ -362,12 +362,17 @@ _pinfo::commune_send (DWORD code)
|
|||
if (sig_send (this, __SIGCOMMUNE))
|
||||
goto err;
|
||||
|
||||
/* FIXME: Need something better than an busy loop here */
|
||||
bool isalive;
|
||||
while ((isalive = alive ()))
|
||||
if (myself->hello_pid <= 0)
|
||||
break;
|
||||
else
|
||||
{
|
||||
DWORD prio = SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
|
||||
Sleep (0);
|
||||
SetThreadPriority (GetCurrentThread (), prio);
|
||||
}
|
||||
|
||||
CloseHandle (tome);
|
||||
tome = NULL;
|
||||
|
|
Loading…
Reference in New Issue