[Commit] nickle execute.c,1.80,1.81 main.c,1.32,1.33 nickle.h,1.101,1.102 sched.c,1.49,1.50

Keith Packard commit at keithp.com
Mon Jun 9 18:42:48 PDT 2003


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv14632

Modified Files:
	execute.c main.c nickle.h sched.c 
Log Message:
Make nickle exit with error status when the last thread dies with an exception

Index: execute.c
===================================================================
RCS file: /local/src/CVS/nickle/execute.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- execute.c	5 Jun 2003 23:51:23 -0000	1.80
+++ execute.c	10 Jun 2003 00:42:46 -0000	1.81
@@ -1328,7 +1328,7 @@
 		    if (signalFinished)
 		    {
 			signalFinished = False;
-			ThreadFinish (thread);
+			ThreadFinish (thread, False);
 		    }
 		    if (signalException)
 		    {
@@ -1339,7 +1339,7 @@
 		    if (signalError)
 		    {
 			signalError = False;
-			ThreadFinish (thread);
+			ThreadFinish (thread, True);
 		    }
 		    if (signalProfile)
 			signalProfile = False;

Index: main.c
===================================================================
RCS file: /local/src/CVS/nickle/main.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- main.c	22 Apr 2003 23:25:38 -0000	1.32
+++ main.c	10 Jun 2003 00:42:46 -0000	1.33
@@ -86,7 +86,7 @@
     (void) yyparse ();
     IoFini ();
     FileFini ();
-    return 0;
+    return lastThreadError;
 }
 
 void

Index: nickle.h
===================================================================
RCS file: /local/src/CVS/nickle/nickle.h,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- nickle.h	5 Jun 2003 23:51:23 -0000	1.101
+++ nickle.h	10 Jun 2003 00:42:46 -0000	1.102
@@ -566,6 +566,8 @@
     WakeAll, WakeOne
 } WakeKind;
 
+extern Bool lastThreadError;
+
 Value	    NewThread (FramePtr frame, ObjPtr code);
 void	    ThreadSleep (Value thread, Value sleep, int priority);
 void	    ThreadStepped (Value thread);
@@ -573,7 +575,7 @@
 void	    ThreadsRun (Value thread, Value lex);
 void	    ThreadsInterrupt (void);
 void	    ThreadsContinue (void);
-void	    ThreadFinish (Value thread);
+void	    ThreadFinish (Value thread, Bool error);
 void	    ThreadSetState (Value thread, ThreadState state);
 void	    ThreadClearState (Value thread, ThreadState state);
 void	    ThreadInit (void);

Index: sched.c
===================================================================
RCS file: /local/src/CVS/nickle/sched.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- sched.c	3 Jun 2003 06:03:56 -0000	1.49
+++ sched.c	10 Jun 2003 00:42:46 -0000	1.50
@@ -110,11 +110,14 @@
     }
 }
 
+Bool	lastThreadError;
+
 void
-ThreadFinish (Value thread)
+ThreadFinish (Value thread, Bool error)
 {
     ThreadSetState (thread, ThreadFinished);
     ThreadsWakeup (thread, WakeAll);
+    lastThreadError = error;
 }
 
 void
@@ -315,7 +318,7 @@
 	ret = 0;
     else
 	ret = 1;
-    ThreadFinish (thread);
+    ThreadFinish (thread, False);
     return ret;
 }
 




More information about the Commit mailing list