Change 16361: Safe signals for Mac OS

[email protected] (Chris Nandor) Thu, 2 May 2002 23:01:29 -0400
Newsgroups perl.perl5.changes.mac
Message-ID <p05100304b8f7ae010dc3@[10.0.1.177]>
Change 16361 by pudge@pudge-mobile on 2002/05/03 01:56:24

	Safe signals for Mac OS

Affected files ...

.... //depot/macperl/macos/macish.c#3 edit
.... //depot/macperl/macos/macish.h#4 edit

Differences ...

==== //depot/macperl/macos/macish.c#3 (text) ====
Index: perl/macos/macish.c
--- perl/macos/macish.c.~1~	Thu May  2 20:00:05 2002
+++ perl/macos/macish.c	Thu May  2 20:00:05 2002
@@ -799,6 +799,7 @@
 
 void MacPerl_DoAsyncTasks()
 {
+	dTHX;
 	QElemPtr			elem;
 	MacPerl_AsyncTask * task;
 	
@@ -806,8 +807,12 @@
 	while (elem = sMacPerlAsyncQueue.qHead) {
 		Dequeue(elem, &sMacPerlAsyncQueue);
 		task = (MacPerl_AsyncTask *) elem;	/* Remove from queue */
-		task->fProc(task);						/* Call procedure */
-		task->fPending = false;					/* Allow it to be queued again */
+		task->fProc(task);					/* Call procedure */
+		task->fPending = false;				/* Allow it to be queued again */
+	}
+
+	if (PL_sig_pending) {
+		despatch_signals();
 	}
 }
 
@@ -822,6 +827,7 @@
 	}
 }
 
+
 /*
  * Asynchronous tasks come in handy to exit gracefully from the middle of a script
  */

==== //depot/macperl/macos/macish.h#4 (text) ====
Index: perl/macos/macish.h
--- perl/macos/macish.h.~1~	Thu May  2 20:00:05 2002
+++ perl/macos/macish.h	Thu May  2 20:00:05 2002
@@ -207,7 +207,7 @@
 
 MP_EXT Boolean			gMacPerl_HasAsyncTasks;
 void MacPerl_DoAsyncTasks();
-#define PERL_ASYNC_CHECK() while (gMacPerl_HasAsyncTasks) MacPerl_DoAsyncTasks()
+#define PERL_ASYNC_CHECK() while (gMacPerl_HasAsyncTasks || PL_sig_pending) MacPerl_DoAsyncTasks()
 typedef struct MacPerl_AsyncTask {
 	void	*	qLink;		/* Don't set */
 	short    qType;		/* Queue type. Ignore */
End of Patch.