mirror of
https://gitee.com/openharmony/resourceschedule_ffrt
synced 2024-11-30 08:40:40 +00:00
code format fix
Signed-off-by: baibaibai <2258359443@qq.com> Signed-off-by: baishimin <2258359443@qq.com>
This commit is contained in:
parent
b73b8e84cd
commit
6759014a30
@ -49,7 +49,7 @@ FFRT_C_API void ffrt_restore_qos_config(void);
|
||||
* reserveNum: mininum number which qos can create worker.{[min, max], default} is {[0,256],8}.
|
||||
* maxConcurrency is amx concurrency num of the qos.{[min, max], default} is {[0,12],8}.
|
||||
* hardLimit: max number which qos can create worker.{[min, max], default} is {[0,256],44}.
|
||||
* @return return ture when setting success.return false when setting fail, and param is default.
|
||||
* @return return 0 when setting success.return -1 when setting fail, and param is default.
|
||||
* @version 1.0
|
||||
*/
|
||||
FFRT_C_API int ffrt_set_qos_worker_num(ffrt_worker_num_param* qosData);
|
||||
|
@ -74,17 +74,14 @@ typedef struct {
|
||||
unsigned int qos;
|
||||
} ffrt_qos_config;
|
||||
|
||||
#ifdef OHOS_STANDARD_SYSTEM
|
||||
#define MAX_QOS_LENGTH 15
|
||||
#else
|
||||
|
||||
#define MAX_QOS_LENGTH 19
|
||||
#endif
|
||||
typedef struct {
|
||||
ffrt_qos_config qosConfigArray[MAX_QOS_LENGTH];
|
||||
unsigned int effectLen;
|
||||
unsigned int lowQosReserveWorkerNum;
|
||||
unsigned int highQosReserveWorkerNum;
|
||||
unsigned int globalReserveWorkerNum;
|
||||
ffrt_qos_config qosConfigArray[MAX_QOS_LENGTH];
|
||||
} ffrt_worker_num_param;
|
||||
|
||||
typedef struct {
|
||||
|
@ -73,7 +73,7 @@ static inline void restore_qos_config()
|
||||
* reserveNum: mininum number which qos can create worker.{[min, max], default} is {[0,256],8}.
|
||||
* maxConcurrency is amx concurrency num of the qos.{[min, max], default} is {[0,12],8}.
|
||||
* hardLimit: max number which qos can create worker.{[min, max], default} is {[0,256],44}.
|
||||
* @return return ture when setting success.return false when setting fail, and param is default.
|
||||
* @return return 0 when setting success.return -1 when setting fail, and param is default.
|
||||
* @version 1.0
|
||||
*/
|
||||
static inline int set_qos_worker_num(ffrt_worker_num_param* qosData)
|
||||
|
@ -304,7 +304,7 @@ void CPUMonitor::WakeupCount(const QoS& qos, bool isDeepSleepWork)
|
||||
void CPUMonitor::DoDestroy(const QoS& qos)
|
||||
{
|
||||
WorkerCtrl& workerCtrl = ctrlQueue[static_cast<int>(qos)];
|
||||
std::unique_lock lk(workerCtrl.lock);
|
||||
std::lock_guard lk(workerCtrl.lock);
|
||||
size_t totalNum = static_cast<size_t>(workerCtrl.sleepingWorkerNum + workerCtrl.executionNum);
|
||||
if (totalNum > workerCtrl.reserveNum) {
|
||||
ReleasePublicWorkerNum(qos);
|
||||
@ -443,7 +443,7 @@ void CPUMonitor::LogAllWorkerNum()
|
||||
FFRT_LOGD("lowQosUseGlobalWorkerToken[%d], highQosUseGlobalWorkerToken[%d]",
|
||||
lowQosUseGlobalWorkerToken->load(), highQosUseGlobalWorkerToken->load());
|
||||
for (int i = 0; i < QoS::MaxNum(); i++) {
|
||||
WorkerCtrl &workerCtrl = ctrlQueue[i];
|
||||
WorkerCtrl& workerCtrl = ctrlQueue[i];
|
||||
size_t runningNum = workerCtrl.executionNum;
|
||||
size_t totalNum = static_cast<size_t>(workerCtrl.sleepingWorkerNum + workerCtrl.executionNum);
|
||||
FFRT_LOGD("succ:qos[%d], reserveNum[%d], maxConcurrency[%d], hardLimit[%d], runningNum[%d], totalNum[%d]",
|
||||
|
Loading…
Reference in New Issue
Block a user