summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx/wqueue.h
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-10-07 07:41:52 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-10-07 07:41:52 -0600
commit7e4a848006a089d8144bc4848efe460872300adc (patch)
tree806ce81920cb4e2d1bc1e3fc29f41806e17dec29 /nuttx/include/nuttx/wqueue.h
parente060c8fd1a254020c8266ef7200d7f5dd026266b (diff)
downloadnuttx-7e4a848006a089d8144bc4848efe460872300adc.tar.gz
nuttx-7e4a848006a089d8144bc4848efe460872300adc.tar.bz2
nuttx-7e4a848006a089d8144bc4848efe460872300adc.zip
Add support for priority inheritance on the low priority worker queue
Diffstat (limited to 'nuttx/include/nuttx/wqueue.h')
-rw-r--r--nuttx/include/nuttx/wqueue.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/wqueue.h b/nuttx/include/nuttx/wqueue.h
index 323b4413d..424373a17 100644
--- a/nuttx/include/nuttx/wqueue.h
+++ b/nuttx/include/nuttx/wqueue.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/wqueue.h
*
- * Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -486,6 +486,48 @@ int work_signal(int qid);
#define work_available(work) ((work)->worker == NULL)
+/****************************************************************************
+ * Name: lpwork_boostpriority
+ *
+ * Description:
+ * Called by the work queue client to assure that the priority of the low-
+ * priority worker thread is at least at the requested level, reqprio. This
+ * function would normally be called just before calling work_queue().
+ *
+ * Parameters:
+ * reqprio - Requested minimum worker thread priority
+ *
+ * Return Value:
+ * None
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_SCHED_LPWORK) && defined(CONFIG_PRIORITY_INHERITANCE)
+void lpwork_boostpriority(uint8_t reqprio);
+#endif
+
+/****************************************************************************
+ * Name: lpwork_restorepriority
+ *
+ * Description:
+ * This function is called to restore the priority after it was previously
+ * boosted. This is often done by client logic on the worker thread when
+ * the scheduled work completes. It will check if we need to drop the
+ * priority of the worker thread.
+ *
+ * Parameters:
+ * reqprio - Previously requested minimum worker thread priority to be
+ * "unboosted"
+ *
+ * Return Value:
+ * None
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_SCHED_LPWORK) && defined(CONFIG_PRIORITY_INHERITANCE)
+void lpwork_restorepriority(uint8_t reqprio);
+#endif
+
#undef EXTERN
#ifdef __cplusplus
}