From 452e744883f17dd7b74547059425f3cad97643af Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Wed, 29 Mar 2017 18:09:58 -0700 Subject: [PATCH] qcacmn: Define API qdf_create_singlethread_workqueue Define API qdf_create_singlethread_workqueue to create a single threaded dedicated work queue. Change-Id: Iab70044888911c1e4adba63e8eee643d5693d716 CRs-Fixed: 2026443 --- qdf/inc/qdf_defer.h | 15 +++++++++++++++ qdf/linux/src/i_qdf_defer.h | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/qdf/inc/qdf_defer.h b/qdf/inc/qdf_defer.h index 642a1f4b2d..49ea6acbe3 100644 --- a/qdf/inc/qdf_defer.h +++ b/qdf/inc/qdf_defer.h @@ -140,6 +140,21 @@ static inline qdf_workqueue_t *qdf_create_workqueue(char *name) return __qdf_create_workqueue(name); } +/** + * qdf_create_singlethread_workqueue() - create a single threaded workqueue + * @name: string + * + * This API creates a dedicated work queue with a single worker thread to avoid + * wasting unnecessary resources when works which needs to be submitted in this + * queue are not very critical and frequent. + * + * Return: pointer of type qdf_workqueue_t + */ +static inline qdf_workqueue_t *qdf_create_singlethread_workqueue(char *name) +{ + return __qdf_create_singlethread_workqueue(name); +} + /** * qdf_queue_work - Queue the work/task * @hdl: OS handle diff --git a/qdf/linux/src/i_qdf_defer.h b/qdf/linux/src/i_qdf_defer.h index d2a2f73048..a8c8919ce5 100644 --- a/qdf/linux/src/i_qdf_defer.h +++ b/qdf/linux/src/i_qdf_defer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -308,6 +308,21 @@ static inline __qdf_workqueue_t *__qdf_create_workqueue(char *name) return create_workqueue(name); } +/** + * __qdf_create_singlethread_workqueue() - create a single threaded workqueue + * @name: string + * + * This API creates a dedicated work queue with a single worker thread to avoid + * wasting unnecessary resources when works which needs to be submitted in this + * queue are not very critical and frequent. + * + * Return: pointer of type qdf_workqueue_t + */ +static inline __qdf_workqueue_t *__qdf_create_singlethread_workqueue(char *name) +{ + return create_singlethread_workqueue(name); +} + /** * __qdf_flush_workqueue - flush the workqueue * @hdl: OS handle