[asterisk-dev] "Generic" or "Core" scheduler thread?

Russell Bryant russell at digium.com
Fri Jun 3 10:30:15 CDT 2011


On 06/03/2011 10:02 AM, Steve Davies wrote:
> I looked through the source, and could not see one, but is there a
> thread than handles some kind of "generic" scheduler that can be used
> by the PBX, or other parts of Asterisk core, in order to
> asynchronously clean up some data structures?
> 
> Specifically, I would like to schedule an ast_channel_free(c) of a
> zombie channel so that it occurs "real soon", but not right now, while
> I have a handful of deadlock causing locks to contend with.

No, there is no generic scheduler thread (yet).  It has crossed my mind
before, though...

Take a look at include/asterisk/sched.h.  It would be fairly straight
forward to add.  You would just allocate a scheduler context and then
run ast_sched_start_thread() on it.

-- 
Russell Bryant
Digium, Inc.   |   Engineering Manager, Open Source Software
445 Jan Davis Drive NW    -     Huntsville, AL 35806  -  USA
www.digium.com  -=-  www.asterisk.org -=- blogs.asterisk.org



More information about the asterisk-dev mailing list