MUTEX_UNLOCK(&thread->mutex);
Perl_ithread_destruct(aTHX_ thread, "no reference");
}
- MUTEX_UNLOCK(&thread->mutex);
+ else {
+ MUTEX_UNLOCK(&thread->mutex);
+ }
}
else {
MUTEX_UNLOCK(&thread->mutex);
MUTEX_INIT(&thread->mutex);
thread->tid = tid_counter++;
thread->gimme = GIMME_V;
- thread->state = (thread->gimme == G_VOID) ? 1 : 0;
/* "Clone" our interpreter into the thread's interpreter
* This gives thread access to "static data" and code.
SvTEMP_off(thread->init_function);
ptr_table_free(PL_ptr_table);
PL_ptr_table = NULL;
+ PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
}
PERL_SET_CONTEXT(aTHX);
}
void
+ithread_list(char *classname)
+PPCODE:
+{
+ ithread *curr_thread;
+ MUTEX_LOCK(&create_destruct_mutex);
+ curr_thread = threads;
+ while(curr_thread) {
+ PUSHs( ithread_to_SV(aTHX_ NULL, curr_thread, classname, TRUE));
+ curr_thread = curr_thread->next;
+ if(curr_thread == threads)
+ break;
+ }
+ MUTEX_UNLOCK(&create_destruct_mutex);
+}
+
+
+void
ithread_self(char *classname)
CODE:
{