OSDN Git Service

Only signal an acquisition thread if the target sensor is enabled
authorPatrick Porlan <patrick.porlan@intel.com>
Wed, 17 Dec 2014 14:49:03 +0000 (15:49 +0100)
committerGerrit Code Review <gerrit2@irsgerrit001.ir.intel.com>
Thu, 18 Dec 2014 08:35:37 +0000 (08:35 +0000)
Otherwise the variable is invalid.

Change-Id: I54c6411b29fd3d10f454e17e46ea6d8dbcc228c6
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
control.c

index 14f5570..917c32d 100644 (file)
--- a/control.c
+++ b/control.c
@@ -767,8 +767,9 @@ static int setup_delay_sysfs (int s, float requested_rate)
 
        /* If we're dealing with a poll-mode sensor */
        if (!sensor[s].num_channels) {
-               /* Wake up thread so the new sampling rate gets used */
-               pthread_cond_signal(&thread_release_cond[s]);
+               if (is_enabled(s))
+                       /* Wake up thread so the new sampling rate gets used */
+                       pthread_cond_signal(&thread_release_cond[s]);
                return 0;
        }