Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / devel-api / threading / mutex.h
index cd41f9a..925f363 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_MUTEX_H__
-#define __DALI_MUTEX_H__
+#ifndef DALI_MUTEX_H
+#define DALI_MUTEX_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 namespace Dali
 {
-
 /**
  * Class to synchronize access to critical resources from multiple threads
  */
-class DALI_IMPORT_API Mutex
+class DALI_CORE_API Mutex
 {
 public:
-
   /**
    * @brief Constructor, acquires the mutex from the underlying OS
    */
@@ -45,27 +43,35 @@ public:
   ~Mutex();
 
   /**
+   * @brief Move constructor
+   */
+  Mutex(Mutex&& rhs) noexcept;
+
+  /**
+   * @brief Move assignment
+   */
+  Mutex &operator=(Mutex&& rhs) noexcept;
+
+  /**
    * @brief Check if the mutex is locked
    * @return true if the mutex is locked
    */
   bool IsLocked();
 
 public:
-
   /**
    * Helper class to do a scoped lock on a mutex implementing the RAII idiom.
    * Note! this class *does not* prevent a deadlock in the case when same thread is
    * locking the same mutex twice.
    */
-  class ScopedLock
+  class DALI_CORE_API ScopedLock
   {
   public:
-
     /**
      * Constructor
      * @param mutex to lock
      */
-    ScopedLock( Mutex& mutex );
+    ScopedLock(Mutex& mutex);
 
     /**
      * Destructor, releases the lock
@@ -77,16 +83,14 @@ public:
   };
 
 private:
-
   /// Not implemented as Mutex is not copyable
-  Mutex( const Mutex& );
-  const Mutex& operator= ( const Mutex& );
+  Mutex(const Mutex&);
+  const Mutex& operator=(const Mutex&);
 
   struct MutexImpl;
   MutexImpl* mImpl;
-
 };
 
 } // namespace Dali
 
-#endif // __DALI_MUTEX_H__
+#endif // DALI_MUTEX_H