Don't decrement the active flag until AFTER we have run perl_destruct
p4raw-id: //depot/perl@17080
}
PerlIO_flush((PerlIO*)NULL);
- MUTEX_LOCK(&create_destruct_mutex);
- active_threads--;
- assert( active_threads >= 0 );
- MUTEX_UNLOCK(&create_destruct_mutex);
MUTEX_LOCK(&thread->mutex);
thread->state |= PERL_ITHR_FINISHED;
} else {
MUTEX_UNLOCK(&thread->mutex);
}
+ MUTEX_LOCK(&create_destruct_mutex);
+ active_threads--;
+ assert( active_threads >= 0 );
+ MUTEX_UNLOCK(&create_destruct_mutex);
+
#ifdef WIN32
return (DWORD)0;
#else