You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of our uses of CPMutex* could likely be replaced with standard std::mutex. But caution: CPLMutex* is recursive, while std::mutex is not. In most cases a regular (non-recursive) std::mutex is probably sufficient, but a std::recursive_mutex might be needed in some places
Steps to reproduce the issue
Versions and provenance
Additional context
No response
The text was updated successfully, but these errors were encountered:
We should be careful though if using std::mutex as global variables, for functions that could be called late in the termination sequence of the process, and after the std::mutex have been freed
For example we have this comment in
void CPL_STDCALL GDALDestroyDriverManager(void)
{
// THREADSAFETY: We would like to lock the mutex here, but it
// needs to be reacquired within the destructor during driver
// deregistration.
// FIXME: Disable following code as it crashed on OSX CI test.
// std::lock_guard<std::mutex> oLock(oDeleteMutex);
if (poDM != nullptr)
{
delete poDM;
poDM = nullptr;
}
}
What is the bug?
Most of our uses of CPMutex* could likely be replaced with standard std::mutex. But caution: CPLMutex* is recursive, while std::mutex is not. In most cases a regular (non-recursive) std::mutex is probably sufficient, but a std::recursive_mutex might be needed in some places
Steps to reproduce the issue
Versions and provenance
Additional context
No response
The text was updated successfully, but these errors were encountered: