#define __DALI_CONDITIONAL_WAIT_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
* 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;
};
/**
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
* 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 );