Bug 1858

Summary: blocking the cloner should also block the clonee
Product: frysk Reporter: Andrew Cagney <cagney>
Component: generalAssignee: Andrew Cagney <cagney>
Status: RESOLVED FIXED    
Severity: normal CC: swagiaal
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 1857    

Description Andrew Cagney 2005-11-11 19:00:12 UTC
this gives the cloner observer a clear well defined oportunity to add things to
the clonee.
Comment 1 Andrew Cagney 2005-11-20 22:02:16 UTC
Work in progress, this moves the block.

Index: frysk-core/frysk/proc/ChangeLog
2005-11-20  Andrew Cagney  <cagney@redhat.com>

        * TaskState.java: Replace state .startRunning with class .Starting
        containing sub-states .waitingForStop and .waitingForUnblock.
        * Task.java: In notifyForked, add blocking observer to fork's
        list.  Similar for notifyCloned.
        * TestTaskForkedObserver.java: Update, also unblock the fork.
        * TestTaskClonedObserver.java: Update, also unblock the clone.
Comment 2 Andrew Cagney 2005-11-21 01:00:42 UTC
2005-11-20  Andrew Cagney  <cagney@redhat.com>

        * TestTaskObserver.java: Add classes .SpawnObserver, and
        .CloneObserver.  Add tests .testBlockedCloneUnblockChildFirst, and
        .testBlockedCloneUnblockParentFirst.
        * TaskObserver.java: Note that Cloned and Forked will block both
        the parent and child.

        * TestLib.java: Add constants childAck, parentAck, addCloneSig,
        delCloneSig, addForkSig, delForkSig, zombieForkSig, execSig to
        AckProcess.  Use.

        * TaskState.java: Replace state .startRunning with class .Starting
        containing sub-states .waitingForStop and .waitingForUnblock.
        * Task.java: In notifyForked, add blocking observer to fork's
        list.  Similar for notifyCloned.
        * TestTaskForkedObserver.java: Update, also unblock the fork.
        * TestTaskClonedObserver.java: Update, also unblock the clone.

        * TaskState.java: Fix typo's, zombied -> disappeared.

        * Task.java: Refactor single constructor into separate unattached,
        attached clone, and attached main constructors.
        * Proc.java: Re-organize constructor code.  Delete
        sendNewAttachedTask.
        * LinuxTask.java: Ditto.
        * LinuxProc.java: Update.
        * LinuxHost.java: Update.  Explicitly create an attached processes
        first task.

        * LinuxHost.java: Pass the forked process's only task to Task
        .performeForked.
        * TaskObserver.java: Change .Forked.updateForked fork parameter to
        a Task.
        * TaskState.java: Update.
        * Task.java: Update.

Comment 3 Andrew Cagney 2005-11-21 01:02:25 UTC
        /**
         * Called when this TASK has cloned, creating CLONE.  Return
         * Action.BLOCK if this observer wants both this task and it's
         * clone to be blocked (each must be separatly unblocked).
         */
        Action updateCloned (Task task, Task clone);