Skip to content
Snippets Groups Projects
  • David M. Lee's avatar
    222e8a3a
    Add a serializer interface to the threadpool · 222e8a3a
    David M. Lee authored
    This patch adds the ability to create a serializer from a thread pool. A
    serializer is a ast_taskprocessor with the same contract as a default
    taskprocessor (tasks execute serially) except instead of executing out
    of a dedicated thread, execution occurs in a thread from a
    ast_threadpool. Think of it as a lightweight thread.
    
    While it guarantees that each task will complete before executing the
    next, there is no guarantee as to which thread from the pool individual
    tasks will execute. This normally only matters if your code relys on
    thread specific information, such as thread locals.
    
    This patch also fixes a bug in how the 'was_empty' parameter is computed
    for the push callback, and gets rid of the unused 'shutting_down' field.
    
    Review: https://reviewboard.asterisk.org/r/2323/
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    222e8a3a
    History
    Add a serializer interface to the threadpool
    David M. Lee authored
    This patch adds the ability to create a serializer from a thread pool. A
    serializer is a ast_taskprocessor with the same contract as a default
    taskprocessor (tasks execute serially) except instead of executing out
    of a dedicated thread, execution occurs in a thread from a
    ast_threadpool. Think of it as a lightweight thread.
    
    While it guarantees that each task will complete before executing the
    next, there is no guarantee as to which thread from the pool individual
    tasks will execute. This normally only matters if your code relys on
    thread specific information, such as thread locals.
    
    This patch also fixes a bug in how the 'was_empty' parameter is computed
    for the push callback, and gets rid of the unused 'shutting_down' field.
    
    Review: https://reviewboard.asterisk.org/r/2323/
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381326 65c4cc65-6c06-0410-ace0-fbb531ad65f3