2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliChildProcTerminator.h"
15 //______________________________________________________________________________
16 // Full description of AliChildProcTerminator
19 ClassImp(AliChildProcTerminator)
21 AliChildProcTerminator* AliChildProcTerminator::fgTheOne = 0;
23 AliChildProcTerminator* AliChildProcTerminator::Instance()
26 fgTheOne = new AliChildProcTerminator;
30 AliChildProcTerminator::AliChildProcTerminator()
33 sac.sa_handler = sig_handler;
34 sigemptyset(&sac.sa_mask);
36 sigaction(SIGCHLD, &sac, 0);
39 void AliChildProcTerminator::sig_handler(int /*sig*/)
42 pid_t pid = wait(&status);
43 Instance()->ChildProcTerm(pid, status);
46 void AliChildProcTerminator::ChildProcTerm(Int_t pid, Int_t status)
49 args[0] = (Long_t) pid;
50 args[1] = (Long_t) status;
52 Emit("ChildProcTerm(Int_t,Int_t)", args);