Merge pull request #4004 from RosettaCommons/vmullig/threadsafe_options_system
Make the options system threadsafe
The options system is a nasty hunk of nonconst global data that isn't threadsafe. Let's make it threadsafe.
Tasks:
- [x] Make `OptionCollection` class threadsafe.
- [x] Including the global variables defined in `OptionCollection.cc`.
- [x] Make `ScalarOption_T_` threadsafe.
- [x] Make `VectorOption_T_` threadsafe.
- [x] Make `Option` class threadsafe.
- [x] Add a `utility::thread::PairedReadLockWriteLockGuard` class for simultaneously read-locking one mutex and write-locking another without deadlock (_e.g._ for copying values from one object to another).
- [x] Make the mutex-locked versions of the functions in `VectorOption_T_` private.
- [x] Beauty.
Possible additional spots to make threadsafe in a future pull request:
- Make `AnyOption` class threadsafe.
- Make `AnyOptionVector` class threadsafe.
- Make `utility::keys::AutoKey` class threadsafe.