work around WIN32 shutdown issues

This commit is contained in:
Jeff Hill
2000-02-23 16:11:30 +00:00
parent a8b4c8a72a
commit 792acfa505
2 changed files with 23 additions and 6 deletions

View File

@@ -312,7 +312,12 @@ epicsShareFunc int epicsShareAPI threadIsSuspended (threadId id)
stat = GetExitCodeThread (pParm->handle, &exitCode);
if (stat) {
return pParm->isSuspended;
if (exitCode!=STILL_ACTIVE) {
return 1;
}
else {
return pParm->isSuspended;
}
}
else {
return 1;

View File

@@ -330,6 +330,23 @@ osiTimerQueue::~osiTimerQueue()
{
osiTimer *pTmr;
this->terminateFlag = true;
this->rescheduleEvent.signal ();
this->exitEvent.wait (0.1);
if ( ! this->exitFlag && ! this->isSuspended () ) {
static const unsigned maxCount = 25;
static const double delay = 0.25;
unsigned count = 0;
printf ("waiting %f seconds for timer queue to shut down",
delay * maxCount);
while ( ! this->exitFlag && ! this->isSuspended () && count < 10) {
this->exitEvent.wait (delay);
printf (".");
count++;
}
printf ("\n");
}
this->mutex.lock ();
//
@@ -347,11 +364,6 @@ osiTimerQueue::~osiTimerQueue()
pTmr->curState = osiTimer::stateLimbo;
pTmr->destroy ();
}
this->terminateFlag = true;
this->rescheduleEvent.signal ();
while (!this->exitFlag) {
this->exitEvent.wait ();
}
}
//