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
old mode 100755 (executable)
new mode 100644 (file)
index d07ef8e..925f363
@@ -2,7 +2,7 @@
 #define DALI_MUTEX_H
 
 /*
- * Copyright (c) 2019 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_CORE_API Mutex
 {
 public:
-
   /**
    * @brief Constructor, acquires the mutex from the underlying OS
    */
@@ -45,13 +43,22 @@ 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
@@ -60,12 +67,11 @@ public:
   class DALI_CORE_API ScopedLock
   {
   public:
-
     /**
      * Constructor
      * @param mutex to lock
      */
-    ScopedLock( Mutex& mutex );
+    ScopedLock(Mutex& mutex);
 
     /**
      * Destructor, releases the lock
@@ -77,14 +83,12 @@ 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