Dali 3D User Interface Engine
conditional-wait.h
Go to the documentation of this file.
1 #ifndef __DALI_CONDITIONAL_WAIT_H__
2 #define __DALI_CONDITIONAL_WAIT_H__
3 
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // INTERNAL INCLUDES
23 
24 namespace Dali
25 {
26 
31 {
32 public:
33 
38  class ScopedLock
39  {
40  public:
46  ScopedLock( ConditionalWait& wait );
47 
52  ~ScopedLock();
53 
58  ConditionalWait& GetLockedWait() const { return mWait; }
59 
60  private:
61 
62  // Not implemented as ScopedLock cannot be copied:
63  ScopedLock( const ScopedLock& );
64  const ScopedLock& operator=( const ScopedLock& );
65 
67  };
68 
73 
77  ~ConditionalWait();
78 
85  void Notify();
86 
97  void Notify( const ScopedLock& scope );
98 
104  void Wait();
105 
116  void Wait( const ScopedLock& scope );
117 
122  unsigned int GetWaitCount() const;
123 
124 private:
125 
126  // Not implemented as ConditionalWait is not copyable
128  const ConditionalWait& operator=( const ConditionalWait& );
129 
132 
133 };
134 
135 } // namespace Dali
136 
137 #endif // __DALI_CONDITIONAL_WAIT_H__
Dali Docs Home
Read more about Dali