use sig_atomic_t for run flag in examples
Otherwise the loop may run forever.
This commit is contained in:
parent
1dae91d8c3
commit
3ba71d5702
|
|
@ -38,7 +38,7 @@ RT_TASK *task;
|
||||||
|
|
||||||
const static unsigned int cycle_us = 1000; /* 1 ms */
|
const static unsigned int cycle_us = 1000; /* 1 ms */
|
||||||
|
|
||||||
static int run = 1;
|
static volatile sig_atomic_t run = 1;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ RT_TASK *task;
|
||||||
|
|
||||||
static unsigned int cycle_ns = 1000000; /* 1 ms */
|
static unsigned int cycle_ns = 1000000; /* 1 ms */
|
||||||
|
|
||||||
static int run = 1;
|
static volatile sig_atomic_t run = 1;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
RT_TASK my_task;
|
RT_TASK my_task;
|
||||||
|
|
||||||
static int run = 1;
|
static volatile sig_atomic_t run = 1;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ static unsigned int cycle_us = 1000; /* 1 ms */
|
||||||
|
|
||||||
static pthread_t cyclic_thread;
|
static pthread_t cyclic_thread;
|
||||||
|
|
||||||
static int run = 1;
|
static volatile sig_atomic_t run = 1;
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue