Skip to content
Snippets Groups Projects
  1. Oct 17, 2018
    • Corey Farrell's avatar
      taskprocessor: Warn on unused result from pushing task. · 5ab94d2a
      Corey Farrell authored
      Add attribute_warn_unused_result to ast_taskprocessor_push,
      ast_taskprocessor_push_local and ast_threadpool_push.  This will help
      ensure we perform the necessary cleanup upon failure.
      
      Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d
      5ab94d2a
  2. Feb 18, 2016
    • Mark Michelson's avatar
      Fix failing threadpool_auto_increment test. · 8055d080
      Mark Michelson authored
      The threadpool_auto_increment test fails infrequently for a couple of
      reasons
      * The threadpool listener was notified of fewer tasks being pushed than
        were actually pushed
      * The "was_empty" flag was set to an unexpected value.
      
      The problem is that the test pushes three tasks into the threadpool.
      Test expects the threadpool to essentially gather those three tasks, and
      then distribute those to the threadpool threads. It also expects that as
      the tasks are pushed in, the threadpool listener is alerted immediately
      that the tasks have been pushed. In reality, a task can be distributed
      to the threadpool threads quicker than expected, meaning that the
      threadpool has already emptied by the time each subsequent task is
      pushed. In addition, the internal threadpool queue can be delayed so
      that the threadpool listener is not alerted that a task has been pushed
      even after the task has been executed.
      
      From the test's point of view, there's no way to be able to predict
      exactly the order that task execution/listener notifications will occur,
      and there is no way to know which listener notifications will indicate
      that the threadpool was previously empty.
      
      For this reason, the test has been updated to only check the things it
      can check. It ensures that all tasks get executed, that the threads go
      idle after the tasks are executed, and that the listener is told the
      proper number of tasks that were pushed.
      
      Change-Id: I7673120d74adad64ae6894594a606e102d9a1f2c
      8055d080
  3. Jan 19, 2016
    • Joshua Colp's avatar
      test_threadpool: Wait for each task to complete and fix memory leak. · 9fa76ba2
      Joshua Colp authored
      This change makes the thread_timeout_thrash unit test wait for
      each task to complete. This fixes the problem where the test would
      prematurely end when all threads were gone and a new one had to be
      started to handle the last task. It also increases the thrasing as
      it is now more likely for each task to encounter the above scenario.
      
      This also fixes a memory leak where the data for each task was not
      being freed.
      
      ASTERISK-25611 #close
      
      Change-Id: I5017d621a4dc911f509074c16229b86bff2fb3c6
      9fa76ba2
  4. Nov 11, 2015
    • Joshua Colp's avatar
      threadpool: Handle worker thread transitioning to dead when going active. · 29543544
      Joshua Colp authored
      This change adds handling of dead worker threads when moving them
      to be active. When this happens the worker thread is removed from
      both the active and idle threads container. If no threads are able
      to be moved to active then the pool grows as configured.
      
      A unit test has also been added which thrashes the idle timeout
      and thread activation to exploit any race conditions between the
      two.
      
      ASTERISK-25546 #close
      
      Change-Id: I6c455f9a40de60d9e86458d447b548fb52ba1143
      29543544
  5. Jun 24, 2015
    • Richard Mudgett's avatar
      Unit tests: Fix unit test description strings. · 9c6d72e3
      Richard Mudgett authored
      Analyzing the code shows that the unit test summary and description
      strings should not end with a new-line character.  Where these strings are
      used in the code a new-line is provided for output.
      
      Change-Id: I129284f5e7ca93d82532334076da4c462d3d9fba
      9c6d72e3
  6. Feb 12, 2013
    • David M. Lee's avatar
      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
  7. Jan 17, 2013
  8. Jan 15, 2013
  9. Jan 07, 2013
  10. Dec 11, 2012
  11. Dec 10, 2012
  12. Dec 09, 2012
  13. Dec 08, 2012
  14. Dec 07, 2012
  15. Dec 06, 2012
Loading