mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Spinlock within the destroy, to allow a scheduled job to continue, if it's
waiting on the mutex which the destroy thread has. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -60,6 +60,22 @@ extern "C" {
|
||||
(_sched_res); \
|
||||
})
|
||||
|
||||
#define AST_SCHED_DEL_SPINLOCK(sched, id, lock) \
|
||||
({ \
|
||||
int _count = 0; \
|
||||
int _sched_res = -1; \
|
||||
while (id > -1 && (_sched_res = ast_sched_del(sched, id)) && ++_count < 10) { \
|
||||
ast_mutex_unlock(lock); \
|
||||
usleep(1); \
|
||||
ast_mutex_lock(lock); \
|
||||
} \
|
||||
if (_count == 10 && option_debug > 2) { \
|
||||
ast_log(LOG_DEBUG, "Unable to cancel schedule ID %d.\n", id); \
|
||||
} \
|
||||
id = -1; \
|
||||
(_sched_res); \
|
||||
})
|
||||
|
||||
struct sched_context;
|
||||
|
||||
/*! \brief New schedule context
|
||||
|
Reference in New Issue
Block a user