YOU must make your project thread-safe...
#include <PhHistogramFactory.hh>
hf = PhHistogramFactory::instance();
h1 = hf->CreateH1F("H1", "Channel 0", 101,-49.5,49.5);
h1 = hf->CreateH1F("H1", "Channel 0", 101,-49.5,49.5);
Obviously, that’s not thread-safe. You have to put locks in place (and slow us down) or force the processing to be stopped before the routines are called.
int process_event (Event * e)
Packet *p = e->getPacket(1003);
if (h1) h1->Fill (p->iValue(0));
Would that work? Always? :-)