Revert "[Tizen] Add codes for Dali Windows Backend"
[platform/core/uifw/dali-core.git] / dali / devel-api / threading / conditional-wait.h
index 4315fed..24a0874 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_CONDITIONAL_WAIT_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -27,7 +27,7 @@ namespace Dali
 /**
  * Helper class to allow conditional waiting and notifications between multiple threads.
  */
-class DALI_IMPORT_API ConditionalWait
+class DALI_CORE_API ConditionalWait
 {
 public:
 
@@ -55,15 +55,18 @@ public:
      * Getter for the ConditionalWait locked for this instance's lifetime.
      * @return the ConditionalWait object currently locked.
      */
-    ConditionalWait& GetLockedWait() const { return mWait; }
+    ConditionalWait& GetLockedWait() const;
+
+  public: // Data, public to allow nesting class to access
+
+    struct ScopedLockImpl;
+    ScopedLockImpl* mImpl;
 
   private:
 
     // Not implemented as ScopedLock cannot be copied:
     ScopedLock( const ScopedLock& );
     const ScopedLock& operator=( const ScopedLock& );
-
-    ConditionalWait& mWait;
   };
 
   /**
@@ -85,6 +88,18 @@ public:
   void Notify();
 
   /**
+   * @brief Notifies another thread to continue if it is blocked on a wait.
+   *
+   * Assumes that the ScopedLock object passed in has already locked the internal state of
+   * this object.
+   * Can be called from any thread.
+   * Does not block the current thread but may cause a rescheduling of threads.
+   *
+   * @param[in] scope A pre-existing lock on the internal state of this object.
+   */
+  void Notify( const ScopedLock& scope );
+
+  /**
    * @brief Wait for another thread to notify us when the condition is true and we can continue
    *
    * Will always block current thread until Notify is called
@@ -98,7 +113,7 @@ public:
    * Assumes that the ScopedLock object passed in has already locked the internal state of
    * this object. Releases the lock while waiting and re-acquires it when returning
    * from the wait.
-   * param[in] scope A pre-existing lock on the internal state of this object.
+   * @param[in] scope A pre-existing lock on the internal state of this object.
    * @pre scope must have been passed this ConditionalWait during its construction.
    */
   void Wait( const ScopedLock& scope );