This patch should fix some data races when a python script (i.e. a
Scripted Process) has a nested call to another python script (i.e. a
OperatingSystem Plugin), which can cause concurrent writes to the python
lock count.
This patch also fixes a data race happening when resetting the operating
system unique pointer.
To address these issues, both accesses is guarded by a mutex.
rdar://109413039
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
We should probably take the lock here as well. It won't be super meaningful (the value can change after the function returns) but I think TSan will complain about the potential race.