8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

Backported fix for CORE-4644: Get open database errors under heavy concurrent load

This commit is contained in:
alexpeshkoff 2015-02-03 11:58:03 +00:00
parent 5b567f2f70
commit ef23fd4fcf

View File

@ -137,7 +137,9 @@ namespace {
#ifndef NO_NFS
const char* NFS_TYPE = "nfs";
class Mnt
Firebird::GlobalPtr<Firebird::Mutex> mntinfoMutex;
class Mnt : public Firebird::MutexLockGuard // Protect static values returned by getmntinfo()/getmntent()
{
#ifdef DARWIN
private:
@ -147,7 +149,8 @@ namespace {
public:
Mnt()
: mnt_info(NULL), mnt_cnt(getmntinfo(&mnt_info, MNT_NOWAIT)), mnt_i(0)
: Firebird::MutexLockGuard(mntinfoMutex),
mnt_info(NULL), mnt_cnt(getmntinfo(&mnt_info, MNT_NOWAIT)), mnt_i(0)
{ }
bool ok() const { return this->mnt_cnt > 0; }
@ -157,7 +160,8 @@ namespace {
public:
Mnt()
: mtab(MTAB_OPEN(MTAB, "r"))
: Firebird::MutexLockGuard(mntinfoMutex),
mtab(MTAB_OPEN(MTAB, "r"))
{ }
~Mnt()