Revert "pjsip: Move from threadpool to taskpool"

This reverts commit bb6b76c2d8.
This commit is contained in:
Joshua C. Colp
2025-10-27 10:06:49 -03:00
committed by Asterisk Development Team
parent 38f2fd2527
commit 54da3e1b9e
21 changed files with 273 additions and 283 deletions

View File

@@ -1921,7 +1921,7 @@ struct ast_sip_endpoint *ast_sip_get_artificial_endpoint(void);
* There are three major types of threads that SIP will have to deal with:
* \li Asterisk threads
* \li PJSIP threads
* \li SIP taskpool threads (a.k.a. "servants")
* \li SIP threadpool threads (a.k.a. "servants")
*
* \par Asterisk Threads
*
@@ -1963,7 +1963,7 @@ struct ast_sip_endpoint *ast_sip_get_artificial_endpoint(void);
* is NULL, then the work will be handed off to whatever servant can currently handle
* the task. If this pointer is non-NULL, then the task will not be executed until
* previous tasks pushed with the same serializer have completed. For more information
* on serializers and the benefits they provide, see \ref ast_taskpool_serializer
* on serializers and the benefits they provide, see \ref ast_threadpool_serializer
*
* \par Scheduler
*
@@ -1992,7 +1992,7 @@ typedef int (*ast_sip_task)(void *user_data);
* \brief Create a new serializer for SIP tasks
* \since 13.8.0
*
* See \ref ast_taskpool_serializer for more information on serializers.
* See \ref ast_threadpool_serializer for more information on serializers.
* SIP creates serializers so that tasks operating on similar data will run
* in sequence.
*
@@ -2009,7 +2009,7 @@ struct ast_serializer_shutdown_group;
* \brief Create a new serializer for SIP tasks
* \since 13.8.0
*
* See \ref ast_taskpool_serializer for more information on serializers.
* See \ref ast_threadpool_serializer for more information on serializers.
* SIP creates serializers so that tasks operating on similar data will run
* in sequence.
*
@@ -2251,7 +2251,7 @@ enum ast_sip_scheduler_task_flags {
struct ast_sip_sched_task;
/*!
* \brief Schedule a task to run in the res_pjsip taskpool
* \brief Schedule a task to run in the res_pjsip thread pool
* \since 13.9.0
*
* \param serializer The serializer to use. If NULL, don't use a serializer (see note below)
@@ -2266,7 +2266,7 @@ struct ast_sip_sched_task;
* \par Serialization
*
* Specifying a serializer guarantees serialized execution but NOT specifying a serializer
* may still result in tasks being effectively serialized if the taskpool is busy.
* may still result in tasks being effectively serialized if the thread pool is busy.
* The point of the serializer BTW is not to prevent parallel executions of the SAME task.
* That happens automatically (see below). It's to prevent the task from running at the same
* time as other work using the same serializer, whether or not it's being run by the scheduler.
@@ -3662,15 +3662,15 @@ int ast_sip_get_host_ip(int af, pj_sockaddr *addr);
const char *ast_sip_get_host_ip_string(int af);
/*!
* \brief Return the size of the SIP taskpool's task queue
* \brief Return the size of the SIP threadpool's task queue
* \since 13.7.0
*/
long ast_sip_taskpool_queue_size(void);
long ast_sip_threadpool_queue_size(void);
/*!
* \brief Retrieve the SIP taskpool object
* \brief Retrieve the SIP threadpool object
*/
struct ast_taskpool *ast_sip_taskpool(void);
struct ast_threadpool *ast_sip_threadpool(void);
/*!
* \brief Retrieve transport state

View File

@@ -195,7 +195,7 @@ struct ast_sip_session {
struct ao2_container *datastores;
/*! Serializer for tasks relating to this SIP session */
struct ast_taskprocessor *serializer;
/*! \deprecated Non-null if the session serializer is suspended or being suspended. */
/*! Non-null if the session serializer is suspended or being suspended. */
struct ast_sip_session_suspender *suspended;
/*! Requests that could not be sent due to current inv_session state */
AST_LIST_HEAD_NOLOCK(, ast_sip_session_delayed_request) delayed_requests;

View File

@@ -318,24 +318,4 @@ struct ast_taskprocessor *ast_taskpool_serializer_group(const char *name,
*/
int ast_taskpool_serializer_push_wait(struct ast_taskprocessor *serializer, int (*task)(void *data), void *data);
/*!
* \brief Suspend a serializer, causing tasks to be queued until unsuspended
* \since 23.1.0
* \since 22.7.0
* \since 20.17.0
*
* \param serializer The serializer to suspend
*/
void ast_taskpool_serializer_suspend(struct ast_taskprocessor *serializer);
/*!
* \brief Unsuspend a serializer, causing tasks to be executed
* \since 23.1.0
* \since 22.7.0
* \since 20.17.0
*
* \param serializer The serializer to unsuspend
*/
void ast_taskpool_serializer_unsuspend(struct ast_taskprocessor *serializer);
#endif /* ASTERISK_TASKPOOL_H */