Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!zardoz.cpd.com!dhw68k!felix!wfischer From: wfischer@felix.UUCP (Bill Fischer) Newsgroups: comp.sys.amiga.tech Subject: What's wrong with this picture?? Keywords: Exec 2.0 Task Message-ID: <154108@felix.UUCP> Date: 21 Nov 90 14:53:27 GMT Sender: news@felix.UUCP Reply-To: wfischer@felix.UUCP (Bill Fischer) Organization: FileNet Corp., Costa Mesa, CA Lines: 51 Assuming that program A started up program B by using the standard technique of: LoadSeg() CreateProc() /* prog.foo */ PutMsg() then program A should be able to 'freeze' program B, to temporarily suspend it's operation by calling the following fuction: FreezeProg() { Disable(); tsk = (struct Task*)FindTask("prog.foo"); Remove(tsk); tsk->tc_State = tsk->tc_State + 4; Enable(); return(0); } And to 'unfreeze' (or restart) program B by calling the following function: MeltProg() { Disable(); if (tsk->tc_State == 8) AddTail(&SysBase->TaskReady,tsk); else AddTail(&SysBase->TaskWait,tsk); tsk->tc_State = tsk->tc_State - 4; Enable(); sig = tsk->tc_SigAlloc & tsk->tc_SigRecvd; if (sig != 0) Signal(tsk,sig); return(0); } The problem I have is that some programs don't come back to life when I call MeltProg(). To make it even more complicated, the programs that won't 'unfreeze', do so intermittently.... In other words, sometimes they restart OK and sometimes they won't. I might add that this technique worked pretty well under KS 1.3 but doesn't work AT ALL under 2.0. Am I breaking any rules here?? Under 2.0 I get a software error - task held requestor. Regards B F ..!hplabs!fritz!wfischer