Skip to content

Commit

Permalink
minor: fixed shared to exclusive lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey N. Vinogradov committed Jul 18, 2017
1 parent 0b01116 commit f353326
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sphinxstd.h
Expand Up @@ -2992,15 +2992,15 @@ class CAPABILITY ( "mutex" ) CSphMutex : public ISphNoncopyable

bool Lock () ACQUIRE();
bool Unlock () RELEASE();
bool TimedLock ( int iMsec ) TRY_ACQUIRE(false);
bool TimedLock ( int iMsec ) TRY_ACQUIRE(true);

protected:
#if USE_WINDOWS
HANDLE m_hMutex;
#else
pthread_mutex_t * m_pMutex;
public:
inline pthread_mutex_t* GetInternalMutex() RETURN_CAPABILITY(this)
inline pthread_mutex_t* GetInternalMutex()
{
return m_pMutex;
}
Expand Down Expand Up @@ -3129,12 +3129,12 @@ class SCOPED_CAPABILITY CSphScopedRLock : ISphNoncopyable
CSphRwlock & m_tLock;
};

/// scoped shared (write) lock
/// scoped exclusive (write) lock
class SCOPED_CAPABILITY CSphScopedWLock : ISphNoncopyable
{
public:
/// lock on creation
CSphScopedWLock ( CSphRwlock & tLock ) ACQUIRE_SHARED( tLock )
CSphScopedWLock ( CSphRwlock & tLock ) ACQUIRE ( tLock )
: m_tLock ( tLock )
{
m_tLock.WriteLock();
Expand Down

0 comments on commit f353326

Please sign in to comment.