| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

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
26 class AAX_CMutex
27{
28 public:
29 AAX_CMutex();
30 ~AAX_CMutex();
31
32 bool Lock();
33 void Unlock();
34 bool Try_Lock();
35
36 private:
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
46 class AAX_StLock_Guard
47{
48 public:
49 explicit AAX_StLock_Guard(AAX_CMutex& iMutex) : mMutex(iMutex) { mNeedsUnlock = mMutex.Lock(); }
50 ~AAX_StLock_Guard() { if (mNeedsUnlock) mMutex.Unlock(); }
51
52 private:
53 AAX_StLock_Guard(AAX_StLock_Guard const&);
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
AAX_CMutex
Mutex with try lock functionality.
Definition: AAX_CMutex.h:27
AAX_CMutex::~AAX_CMutex
~AAX_CMutex()
AAX_CMutex::AAX_CMutex
AAX_CMutex()
AAX_CMutex::Unlock
void Unlock()
AAX_CMutex::Lock
bool Lock()
AAX_CMutex::Try_Lock
bool Try_Lock()
AAX_StLock_Guard
Helper class for working with mutex.
Definition: AAX_CMutex.h:47
AAX_StLock_Guard::~AAX_StLock_Guard
~AAX_StLock_Guard()
Definition: AAX_CMutex.h:50
AAX_StLock_Guard::AAX_StLock_Guard
AAX_StLock_Guard(AAX_CMutex &iMutex)
Definition: AAX_CMutex.h:49