aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/sched.h')
-rw-r--r--include/asterisk/sched.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h
index d80beb5bc..829a1b0f6 100644
--- a/include/asterisk/sched.h
+++ b/include/asterisk/sched.h
@@ -54,14 +54,17 @@ extern "C" {
* macro should NOT be used.
*/
#define AST_SCHED_DEL(sched, id) \
- do { \
+ ({ \
int _count = 0; \
- while (id > -1 && ast_sched_del(sched, id) && ++_count < 10) \
+ int _sched_res = -1; \
+ while (id > -1 && (_sched_res = ast_sched_del(sched, id)) && ++_count < 10) \
usleep(1); \
- if (_count == 10 && option_debug > 2) \
+ if (_count == 10 && option_debug > 2) { \
ast_log(LOG_DEBUG, "Unable to cancel schedule ID %d.\n", id); \
+ } \
id = -1; \
- } while (0);
+ (_sched_res); \
+ })
struct sched_context;