@Thomas
Your code has a bug, it doesn't clear instruction cache for the jmp instruction. Add
CacheClearE(&segl->jump, 6, CACRF_ClearI); after the jmp has been poked.
[EDIT] Ahh, but this is KS 1.x example... Ok, that won't work. Forget that one.. :-) [/EDIT]
[EDIT2] Here's a KS 1.x compatible cache clear routine:
include "exec/execbase.i"
include "lvo/exec.i"
MyCacheClearU
movem.l d0-d1/a0-a1/a6,-(sp)
pea (.cleanexit,pc)
move.l (4).w,a6
cmp.w #37,(LIB_VERSION,a6)
blo.b .manualclear
jmp (_LVOCacheClearU,a6)
.cleanexit
movem.l (sp)+,d0-d1/a0-a1/a6
rts
.manualclear
move.l a5,-(sp)
lea (.cacheclrsv,pc),a5
jsr (_LVOSupervisor,a6)
move.l (sp)+,a5
rts
.cacheclrsv
btst #AFB_68020,(AttnFlags+1,a6)
beq.b .nocache
btst #AFB_68040,(AttnFlags+1,a6)
beq.b .is020or030
; 040/060
cpusha bc
cinva bc
nop
rte
.is020or030
movec cacr,d0
or.w #CACRF_ClearI!CACRF_ClearD,d0
movec d0,cacr
.nocache
rte
[/EDIT2]
Also, Wait()ing for signal clears it. Thus it's possible that the subprocess never sees the SIGBREAKF_CTRL_C.
Relying on some Delay() + subprocessing cleaning up in the meanwhile is a bit bad coding style, especially if it ends up doing RemTask() which can potentially lock the system.
An important note when working with multiple threads is that ANSI runtime routines, especially buffered I/O (printf etc.) are not thread-safe and can give various strange results. You should use the AmigaDOS equivalents (e.g. Printf with a capital "P") instead.
Actually, many AmigaDOS functions aren't thread safe either, especially buffered I/O ones.