File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,24 @@ int work_queue_wq(FAR struct kwork_wqueue_s *wqueue,
413
413
FAR struct work_s * work , worker_t worker ,
414
414
FAR void * arg , clock_t delay );
415
415
416
+ /****************************************************************************
417
+ * Name: work_queue_pri
418
+ *
419
+ * Description: Get priority of the wqueue. We believe that all worker
420
+ * threads have the same priority.
421
+ *
422
+ * Input Parameters:
423
+ * wqueue - The work queue handle
424
+ *
425
+ * Returned Value:
426
+ * SCHED_PRIORITY_MIN ~ SCHED_PRIORITY_MAX on success,
427
+ * a negated errno value on failure.
428
+ *
429
+ ****************************************************************************/
430
+
431
+ int work_queue_priority (int qid );
432
+ int work_queue_priority_wq (FAR struct kwork_wqueue_s * wqueue );
433
+
416
434
/****************************************************************************
417
435
* Name: work_cancel/work_cancel_wq
418
436
*
Original file line number Diff line number Diff line change @@ -393,6 +393,46 @@ int work_queue_free(FAR struct kwork_wqueue_s *wqueue)
393
393
return OK ;
394
394
}
395
395
396
+ /****************************************************************************
397
+ * Name: work_queue_priority_wq
398
+ *
399
+ * Description: Get priority of the wqueue. We believe that all worker
400
+ * threads have the same priority.
401
+ *
402
+ * Input Parameters:
403
+ * wqueue - The work queue handle
404
+ *
405
+ * Returned Value:
406
+ * SCHED_PRIORITY_MIN ~ SCHED_PRIORITY_MAX on success,
407
+ * a negated errno value on failure.
408
+ *
409
+ ****************************************************************************/
410
+
411
+ int work_queue_priority_wq (FAR struct kwork_wqueue_s * wqueue )
412
+ {
413
+ FAR struct tcb_s * tcb ;
414
+
415
+ if (wqueue == NULL )
416
+ {
417
+ return - EINVAL ;
418
+ }
419
+
420
+ /* Find for the TCB associated with matching PID */
421
+
422
+ tcb = nxsched_get_tcb (wqueue -> worker [0 ].pid );
423
+ if (!tcb )
424
+ {
425
+ return - ESRCH ;
426
+ }
427
+
428
+ return tcb -> sched_priority ;
429
+ }
430
+
431
+ int work_queue_priority (int qid )
432
+ {
433
+ return work_queue_priority_wq (work_qid2wq (qid ));
434
+ }
435
+
396
436
/****************************************************************************
397
437
* Name: work_start_highpri
398
438
*
You can’t perform that action at this time.
0 commit comments