mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
prc: fix recursive use of non-recursive mutex
This commit is contained in:
parent
0ef9f9bef5
commit
666568a513
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "configVariableBool.h"
|
#include "configVariableBool.h"
|
||||||
|
#include "mutexImpl.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refreshes the cached value.
|
* Refreshes the cached value.
|
||||||
@ -21,7 +22,10 @@ reload_value() const {
|
|||||||
// NB. MSVC doesn't guarantee that this mutex is initialized in a
|
// NB. MSVC doesn't guarantee that this mutex is initialized in a
|
||||||
// thread-safe manner. But chances are that the first time this is called
|
// thread-safe manner. But chances are that the first time this is called
|
||||||
// is at static init time, when there is no risk of data races.
|
// is at static init time, when there is no risk of data races.
|
||||||
static MutexImpl lock;
|
|
||||||
|
// This needs to be a recursive mutex, because get_bool_word() may end up
|
||||||
|
// indirectly querying another bool config variable.
|
||||||
|
static ReMutexImpl lock;
|
||||||
lock.lock();
|
lock.lock();
|
||||||
|
|
||||||
// We check again for cache validity since another thread may have beaten
|
// We check again for cache validity since another thread may have beaten
|
||||||
|
Loading…
x
Reference in New Issue
Block a user