KiCad PCB EDA Suite
Loading...
Searching...
No Matches
access_engine_mutex.cpp File Reference
#include "access_engine_mutex.h"
#include <wx/intl.h>
#include <wx/string.h>

Go to the source code of this file.

Functions

std::timed_mutex & AccessEngineMutex ()
 The one lock every user of the Microsoft Access engine takes while the engine initializes or unloads.
 
std::unique_lock< std::timed_mutex > LockAccessEngine (std::chrono::steady_clock::time_point aDeadline)
 
std::string AccessEngineBusyMessage ()
 

Function Documentation

◆ AccessEngineBusyMessage()

std::string AccessEngineBusyMessage ( )
Returns
the text shown when the engine lock could not be taken in time

Definition at line 40 of file access_engine_mutex.cpp.

References _.

Referenced by ACE_BACKEND::closeOnWorker(), ACE_BACKEND::Connect(), ODBC_BACKEND::Connect(), describeFailure(), ODBC_BACKEND::Disconnect(), and ACE_BACKEND::runOnWorker().

◆ AccessEngineMutex()

std::timed_mutex & AccessEngineMutex ( )

The one lock every user of the Microsoft Access engine takes while the engine initializes or unloads.

The ODBC driver and the ACE OLE DB provider load the same Office libraries, and those race when two threads start or stop the engine at once.

The lock is defined once, in access_engine_mutex.cpp, and never destroyed so a worker thread still waiting on it at process exit finds it alive. An abandoned worker can hold it without bound, so no caller waits on it without a deadline.

Definition at line 26 of file access_engine_mutex.cpp.

Referenced by LockAccessEngine(), and ODBC_BACKEND::takeAccessDriverLock().

◆ LockAccessEngine()

std::unique_lock< std::timed_mutex > LockAccessEngine ( std::chrono::steady_clock::time_point aDeadline)
Returns
the engine lock taken before aDeadline, or an unowned lock if the deadline passed first

Definition at line 34 of file access_engine_mutex.cpp.

References AccessEngineMutex().

Referenced by ODBC_BACKEND::takeAccessDriverLock().