This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

merge detaching and deatchingInSyscall states


Hi,

This patch merges the detaching and detachingInSyscall states. The only
real difference between these states was that the detachingInSyscall
state handled the case of a syscall event, but didn't handle any of the
other events that might need "bubbling up" like Andrew recently added to
the detached state.

2006-08-30  Mark Wielaard  <mark@klomp.org>

    * TaskState.java: Merge detaching and detachingInSyscall states.

Again it was not really possible to write a test to see whether or not
the "bubbling up" of events now also correctly worked in the syscall
case since it means creating an 'unexpected out of order' event stream
which we only saw with some newer kernels afaik. But all existing tests
of course pass with this change.

Committed,

Mark
Index: frysk-core/frysk/proc/TaskState.java
===================================================================
RCS file: /cvs/frysk/frysk-core/frysk/proc/TaskState.java,v
retrieving revision 1.106
diff -u -r1.106 TaskState.java
--- frysk-core/frysk/proc/TaskState.java	29 Aug 2006 15:55:45 -0000	1.106
+++ frysk-core/frysk/proc/TaskState.java	30 Aug 2006 13:08:07 -0000
@@ -844,13 +844,15 @@
 	    // Remove all tasks, retaining just this one.
 	    task.proc.retain (task);
 	    ((LinuxProc)task.proc).getStat ().refresh();
-	    if (task.notifyExeced () > 0) {
+	    if (task.notifyExeced () > 0)
+	      {
 		return blockedInExecSyscall;
-	    }
-	    else {
+	      }
+	    else
+	      {
 		task.sendContinue (0);
 		return running;
-	    }
+	      }
 	}
 	TaskState handleDisappearedEvent (Task task, Throwable w)
 	{
@@ -1279,7 +1281,7 @@
 	    {
 		logger.log (Level.FINE, "{0} handleDetach\n", task); 
 		task.sendStop ();
-		return detachingInSyscall;
+		return detaching;
 	    }
 	    TaskState handleExecedEvent (Task task)
 	    {
@@ -1416,40 +1418,16 @@
 		task.sendContinue (signal);
 		return detaching;
 	    }
-	};
-
-    private static final TaskState detachingInSyscall =
-	new TaskState ("detachingInSyscall")
-	{
-	    TaskState handleStoppedEvent (Task task)
-	    {
-		logger.log (Level.FINE, "{0} handleStoppedEvent\n", task); 
-		task.sendDetach (0);
-		task.proc.performTaskDetachCompleted (task);
-		return detached;
-	    }
-	    
-        //XXX: why is this needed and why does it mean a syscallExit ?
-        TaskState handleSyscalledEvent (Task task)
-	    {
-		logger.log (Level.FINE, "{0} handleSyscalledEvent\n", task); 
-		task.notifySyscallExit ();
-		task.sendContinue (0);
-		return detaching;
-	    }
-	    TaskState handleTerminatingEvent (Task task, boolean signal,
-					      int value)
+	    //XXX: why is this needed and why does it mean a syscallExit ?
+	    TaskState handleSyscalledEvent (Task task)
 	    {
-		logger.log (Level.FINE, "{0} handleTerminatingEvent\n", task); 
-		if (signal)
-		    task.sendDetach (value);
-		else
-		    task.sendDetach (0);
-		task.proc.performTaskDetachCompleted (task);
-		return detached;
+	      logger.log (Level.FINE, "{0} handleSyscalledEvent\n", task); 
+	      task.notifySyscallExit ();
+	      task.sendContinue (0);
+	      return detaching;
 	    }
-	};
-
+      };
+  
     /**
      * The Task is blocked by a set of observers, remain in this state
      * until all the observers have unblocked themselves.  This state

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]