Problem with multi threaded program and rebinable histo


I have a multi threaded program with plot classes using TH1.
Each Instance uses it’s own TH1 instance.
Each class is protected via a mutex so all operation on a instance can only be used by a single thread at the same time.

When using more than one instance with a histo using the rebin bit kCanRebin.
I get errors. Rebinning of seperate instances might happen at the same time by different threads.

So the question is, is rebinning of independent histos thread safe?



TH1::Rebin creates a temporary object via Clone. If the current ROOT directory is shared amongst thread then the operation is not thread safe.