|
|
@ -358,11 +358,21 @@ error:
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Also returns if the kill flag is set.
|
|
|
|
|
|
|
|
*/
|
|
|
|
void TmThreadsWaitForUnpause(ThreadVars *tv)
|
|
|
|
void TmThreadsWaitForUnpause(ThreadVars *tv)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (TmThreadsCheckFlag(tv, THV_PAUSE)) {
|
|
|
|
if (TmThreadsCheckFlag(tv, THV_PAUSE)) {
|
|
|
|
TmThreadsSetFlag(tv, THV_PAUSED);
|
|
|
|
TmThreadsSetFlag(tv, THV_PAUSED);
|
|
|
|
TmThreadTestThreadUnPaused(tv);
|
|
|
|
|
|
|
|
|
|
|
|
while (TmThreadsCheckFlag(tv, THV_PAUSE)) {
|
|
|
|
|
|
|
|
SleepUsec(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TmThreadsCheckFlag(tv, THV_KILL))
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TmThreadsUnsetFlag(tv, THV_PAUSED);
|
|
|
|
TmThreadsUnsetFlag(tv, THV_PAUSED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1737,24 +1747,6 @@ static void TmThreadDeinitMC(ThreadVars *tv)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* \brief Tests if the thread represented in the arg has been unpaused or not.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The function would return if the thread tv has been unpaused or if the
|
|
|
|
|
|
|
|
* kill flag for the thread has been set.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* \param tv Pointer to the TV instance.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void TmThreadTestThreadUnPaused(ThreadVars *tv)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
while (TmThreadsCheckFlag(tv, THV_PAUSE)) {
|
|
|
|
|
|
|
|
SleepUsec(100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TmThreadsCheckFlag(tv, THV_KILL))
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* \brief Waits till the specified flag(s) is(are) set. We don't bother if
|
|
|
|
* \brief Waits till the specified flag(s) is(are) set. We don't bother if
|
|
|
|
* the kill flag has been set or not on the thread.
|
|
|
|
* the kill flag has been set or not on the thread.
|
|
|
|