Private
Public Access
2
0

gpio.c: Added ISR thread termination flag

Also modified ISR handler logic to account for the flag.

This fixes isrExit() deadlock in Python interactive mode
and prevents a more generic problem of a spurious ISR call
after mraa_gpio_isr_exit() is run.

Closes #268.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2015-10-02 23:42:20 +02:00
committed by Brendan Le Foll
parent 3059c06fa0
commit e6c3dd24a6
2 changed files with 7 additions and 2 deletions

View File

@@ -47,6 +47,7 @@ struct _gpio {
void *isr_args; /**< args return when interupt service request triggered */
pthread_t thread_id; /**< the isr handler thread id */
int isr_value_fp; /**< the isr file pointer on the value */
mraa_boolean_t isr_thread_terminating; /**< is the isr thread being terminated? */
mraa_boolean_t owner; /**< If this context originally exported the pin */
mraa_result_t (*mmap_write) (mraa_gpio_context dev, int value);
int (*mmap_read) (mraa_gpio_context dev);