Introduce thread safety
Summary:
Make the necessary changes to allow the safe use in a multi-threaded environment
- Protect statics: make them const or thread_local
- Improve const-correctness of many functions
- Make thread_local the RNG, particle property table, external factory, decay tables, and sym tables
- Add explicit mutexing to non-thread-safe externals (Sherpa, Tauola, Photos)
- Propagate the EvtGen seed to the Fortran RNG in Tauola
- Some fixes to EvtBtoXsEtap and EvtBtoXsgamma
- Reorganise test code for multi-threading
Test Plan:
Tests give identical results to master branch.
Tests give identical results regardless of number of threads used.
Reviewers: jback, kreps
Reviewed By: jback, kreps
Differential Revision: https://phab.hepforge.org/D132