sched/Kconfig, sched/signal/sig_notification.c: Add configuration option to decide select either the high-priority or low-priority work queue for SIG_EVTHREAD notifications.

This commit is contained in:
igd 2019-08-26 10:54:49 -06:00 committed by Gregory Nutt
parent f1c46b4498
commit 32bac84548
2 changed files with 21 additions and 2 deletions

View File

@ -1340,6 +1340,19 @@ config SIG_EVTHREAD
different mechanism would need to be development to support this
feature on the PROTECTED or KERNEL build.
config SIG_EVTHREAD_HPWORK
bool "SIGEV_EVTHREAD use HPWORK"
default n
depends on SIG_EVTHREAD && CONFIG_SCHED_HPWORK
---help---
if selected, SIGEV_THHREAD will use the high priority work queue.
If not, it will use the low priority work queue (if available).
REVISIT: This solution is non-optimal. Some notifications should
be high priority and others should be lower priority. Ideally, you
should be able to determine which work queue is used on a
notification-by-notification basis.
menuconfig SIG_DEFAULT
bool "Default signal actions"
default n

View File

@ -53,6 +53,12 @@
#include "sched/sched.h"
#include "signal/signal.h"
#ifdef CONFIG_SIG_EVTHREAD_HPWORK
# define SIG_EVTHREAD_WORK HPWORK
#else
# define SIG_EVTHREAD_WORK LPWORK
#endif
/****************************************************************************
* Name: nxsig_notification_worker
*
@ -166,7 +172,7 @@ int nxsig_notification(pid_t pid, FAR struct sigevent *event,
/* Then queue the work */
return work_queue(LPWORK, &work->work,
return work_queue(SIG_EVTHREAD_WORK, &work->work,
nxsig_notification_worker, work, 0);
}
#endif
@ -191,6 +197,6 @@ int nxsig_notification(pid_t pid, FAR struct sigevent *event,
#ifdef CONFIG_SIG_EVTHREAD
void nxsig_cancel_notification(FAR struct sigwork_s *work)
{
work_cancel(LPWORK, &work->work);
work_cancel(SIG_EVTHREAD_WORK, &work->work);
}
#endif