@ -626,7 +626,6 @@ void DetectBufferTypeFinalizeRegistration(void)
enum DetectEngineSyncState {
enum DetectEngineSyncState {
IDLE , /**< ready to start a reload */
IDLE , /**< ready to start a reload */
RELOAD , /**< command main thread to do the reload */
RELOAD , /**< command main thread to do the reload */
DONE , /**< main thread telling us reload is done */
} ;
} ;
@ -664,21 +663,20 @@ int DetectEngineReloadIsStart(void)
}
}
/* main thread sets done when it's done */
/* main thread sets done when it's done */
void DetectEngineReloadSet Don e( void )
void DetectEngineReloadSet Idl e( void )
{
{
SCMutexLock ( & detect_sync . m ) ;
SCMutexLock ( & detect_sync . m ) ;
detect_sync . state = DON E;
detect_sync . state = IDL E;
SCMutexUnlock ( & detect_sync . m ) ;
SCMutexUnlock ( & detect_sync . m ) ;
}
}
/* caller loops this until it returns 1 */
/* caller loops this until it returns 1 */
int DetectEngineReloadIs Don e( void )
int DetectEngineReloadIs Idl e( void )
{
{
int r = 0 ;
int r = 0 ;
SCMutexLock ( & detect_sync . m ) ;
SCMutexLock ( & detect_sync . m ) ;
if ( detect_sync . state = = DON E) {
if ( detect_sync . state = = IDL E) {
r = 1 ;
r = 1 ;
detect_sync . state = IDLE ;
}
}
SCMutexUnlock ( & detect_sync . m ) ;
SCMutexUnlock ( & detect_sync . m ) ;
return r ;
return r ;