1 #ifndef __DALI_INTERNAL_CONDITIONAL_WAIT_H__
2 #define __DALI_INTERNAL_CONDITIONAL_WAIT_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
31 * Helper class to allow conditional waiting and notifications between multiple threads
38 * @brief Constructor, creates the internal synchronization objects
43 * @brief Destructor, non-virtual as this is not a base class
48 * @brief Notifies another thread to continue if it is blocked on a wait.
50 * Can be called from any thread.
51 * Does not block the current thread but may cause a rescheduling of threads.
56 * @brief Wait for another thread to notify us when the condition is true and we can continue
58 * Will always block current thread until Notify is called
63 * @brief Return true if the wait is locked, i.e. someone is waiting for it
64 * @return true if this object is waiting on a thread
66 bool IsWaiting() const;
70 /// Not implemented as ConditionalWait is not copyable
71 ConditionalWait( const ConditionalWait& );
72 const ConditionalWait& operator= ( const ConditionalWait& );
74 struct ConditionalWaitImpl;
75 ConditionalWaitImpl* mImpl;
79 } // namespace Adaptor
81 } // namespace Internal
85 #endif // __DALI_INTERNAL_CONDITIONAL_WAIT_H__