orb: add some comments about locking

This commit is contained in:
Beat Küng
2016-04-29 11:15:15 +02:00
committed by Lorenz Meier
parent 5cf78da7d7
commit aacfd8d553
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -178,6 +178,8 @@ protected:
* Each driver instance has its own lock/semaphore.
*
* Note that we must loop as the wait may be interrupted by a signal.
*
* Careful: lock() calls cannot be nested!
*/
void lock()
{
@@ -195,7 +197,7 @@ protected:
}
private:
px4_sem_t _lock;
px4_sem_t _lock; /**< lock to protect access to all class members (also for derived classes) */
/** disable copy construction for this and all subclasses */
Device(const Device &);
@@ -348,6 +350,8 @@ protected:
*
* The default implementation returns no events.
*
* Lock must already be held when calling this.
*
* @param filep The file that's interested.
* @return The current set of poll events.
*/
@@ -366,6 +370,8 @@ protected:
/**
* Internal implementation of poll_notify.
*
* Lock must already be held when calling this.
*
* @param fds A poll waiter to notify.
* @param events The event(s) to send to the waiter.
*/
+2
View File
@@ -148,6 +148,8 @@ private:
/**
* Check whether a topic appears updated to a subscriber.
*
* Lock must already be held when calling this.
*
* @param sd The subscriber for whom to check.
* @return True if the topic should appear updated to the subscriber
*/