1 #ifndef __DALI_MUTEX_H__
2 #define __DALI_MUTEX_H__
5 * Copyright (c) 2017 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.
22 #include <dali/public-api/common/dali-common.h>
25 * The top level DALi namespace
31 * Class to synchronize access to critical resources from multiple threads
33 class DALI_IMPORT_API Mutex
38 * @brief Constructor, acquires the mutex from the underlying OS
43 * @brief Destructor, non virtual as this is not meant as a base class
48 * @brief Check if the mutex is locked
49 * @return true if the mutex is locked
56 * Helper class to do a scoped lock on a mutex implementing the RAII idiom.
57 * Note! this class *does not* prevent a deadlock in the case when same thread is
58 * locking the same mutex twice.
66 * @param mutex to lock
68 ScopedLock( Mutex& mutex );
71 * Destructor, releases the lock
81 /// Not implemented as Mutex is not copyable
82 Mutex( const Mutex& );
83 const Mutex& operator= ( const Mutex& );
92 #endif // __DALI_MUTEX_H__