AAX SDK 2.6.1
Avid Audio Extensions Development Kit
Loading...
Searching...
No Matches
AAX_CMutex.h
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 *
4 * Copyright 2014-2015, 2023 Avid Technology, Inc.
5 * All rights reserved.
6 *
7 * CONFIDENTIAL: this document contains confidential information of Avid. Do
8 * not disclose to any third party. Use of the information contained in this
9 * document is subject to an Avid SDK license.
10 *
11 */
12
13#ifndef AAX_CMUTEX_H
14#define AAX_CMUTEX_H
15
22/*================================================================================================*/
23
27{
28public:
31
32 bool Lock();
33 void Unlock();
34 bool Try_Lock();
35
36private:
37 AAX_CMutex(const AAX_CMutex&);
38 AAX_CMutex& operator=(const AAX_CMutex&);
39
40 typedef struct opaque_aax_mutex_t * aax_mutex_t;
41 aax_mutex_t mMutex;
42};
43
47{
48public:
49 explicit AAX_StLock_Guard(AAX_CMutex& iMutex) : mMutex(iMutex) { mNeedsUnlock = mMutex.Lock(); }
50 ~AAX_StLock_Guard() { if (mNeedsUnlock) mMutex.Unlock(); }
51
52private:
54 AAX_StLock_Guard& operator=(AAX_StLock_Guard const&);
55
56 AAX_CMutex & mMutex;
57 bool mNeedsUnlock;
58};
59
60#endif // AAX_CMUTEX_H
61
Mutex with try lock functionality.
Definition: AAX_CMutex.h:27
void Unlock()
bool Lock()
bool Try_Lock()
Helper class for working with mutex.
Definition: AAX_CMutex.h:47
~AAX_StLock_Guard()
Definition: AAX_CMutex.h:50
AAX_StLock_Guard(AAX_CMutex &iMutex)
Definition: AAX_CMutex.h:49