I should have tested this better before submitting it. This patch is to Perl 11722 after applying my previous patch. Now callbacks will actually work. :-) - D <dmlloyd@tds.net> --- mg.c-old Tue Aug 21 13:26:52 2001 +++ perl-devel/mg.c Tue Aug 21 15:09:16 2001 @@ -1068,7 +1068,18 @@ void Perl_despatch_signals(pTHX) { - PL_event_pending = 0; + if (PL_callback_head != NULL) { + CALLBACK *cur, *next; + + for (cur = PL_callback_head; cur != NULL; cur = next) { + next = cur->next; + (*cur->callback)(cur->data); + } + } else { + MUTEX_LOCK(&PL_callback_mutex); + PL_event_pending = (PL_callback_head != NULL); + MUTEX_UNLOCK(&PL_callback_mutex); + } if (PL_sig_pending) { int sig; PL_sig_pending = 0; @@ -1079,14 +1090,6 @@ } } } - if (PL_callback_head != NULL) { - CALLBACK *cur, *next; - - for (cur = PL_callback_head; cur != NULL; cur = next) { - next = cur->next; - (*cur->callback)(cur->data); - } - } } /* @@ -1133,6 +1136,7 @@ cbptr->prev = NULL; PL_callback_head = cbptr; cbptr->enabled = 1; + PL_event_pending = 1; } MUTEX_UNLOCK(&PL_callback_mutex);Thread Next