summaryrefslogtreecommitdiff
path: root/nuttx/sched/pthread_setschedparam.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-14 19:30:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-14 19:30:31 +0000
commite135573acc348649e767ca67a1ec189fe4e0fcda (patch)
treeb34f7d2914cba8aeb9311c5bae3771af40054640 /nuttx/sched/pthread_setschedparam.c
parentd76fa866ad009d65396acf1aa08fcffd3b4b041e (diff)
downloadpx4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.tar.gz
px4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.tar.bz2
px4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.zip
Fix STM32 F2/F4 SDIO clocking; Clean-up files in sched/ directory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4940 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/pthread_setschedparam.c')
-rw-r--r--nuttx/sched/pthread_setschedparam.c67
1 files changed, 35 insertions, 32 deletions
diff --git a/nuttx/sched/pthread_setschedparam.c b/nuttx/sched/pthread_setschedparam.c
index e3e3c8ae9..019a7c7a5 100644
--- a/nuttx/sched/pthread_setschedparam.c
+++ b/nuttx/sched/pthread_setschedparam.c
@@ -1,4 +1,4 @@
-/********************************************************************************************
+/****************************************************************************
* pthread_setschedparam.c
*
* Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
@@ -31,55 +31,57 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Included Files
- ********************************************************************************************/
+ ****************************************************************************/
#include <sys/types.h>
#include <pthread.h>
#include <sched.h>
#include <errno.h>
#include <debug.h>
+
#include "pthread_internal.h"
-/********************************************************************************************
+/****************************************************************************
* Definitions
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Type Declarations
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Global Variables
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Variables
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Private Functions
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
+/****************************************************************************
* Public Functions
- ********************************************************************************************/
+ ****************************************************************************/
-/********************************************************************************************
- * Function: pthread_setschedparam
+/****************************************************************************
+ * Name: pthread_setschedparam
*
* Description:
- * The pthread_setschedparam() functions will set the scheduling policy and
- * parameters of threads. For SCHED_FIFO and SCHED_RR, the only required
- * member of the sched_param structure is the priority sched_priority.
+ * The pthread_setschedparam() functions will set the scheduling policy
+ * and parameters of threads. For SCHED_FIFO and SCHED_RR, the only
+ * required member of the sched_param structure is the priority
+ * sched_priority.
*
- * The pthread_setschedparam() function will set the scheduling policy and
- * associated scheduling parameters for the thread whose thread ID is
- * given by 'thread' to the policy and associated parameters provided in
- * 'policy' and 'param', respectively.
+ * The pthread_setschedparam() function will set the scheduling policy
+ * and associated scheduling parameters for the thread whose thread ID
+ * is given by 'thread' to the policy and associated parameters provided
+ * in 'policy' and 'param', respectively.
*
* The policy parameter may have the value SCHED_FIFO, or SCHED_RR
* (SCHED_OTHER and SCHED_SPORADIC, in particular, are not supported).
@@ -99,8 +101,9 @@
* 0 if successful. Otherwise, an error code identifying the cause of the
* failure:
*
- * EINVAL The value specified by 'policy' or one of the scheduling parameters
- * associated with the scheduling policy 'policy' is invalid.
+ * EINVAL The value specified by 'policy' or one of the scheduling
+ * parameters associated with the scheduling policy 'policy' is
+ * invalid.
* ENOTSUP An attempt was made to set the policy or scheduling parameters
* to an unsupported value (SCHED_OTHER and SCHED_SPORADIC in
* particular are not supported)
@@ -113,7 +116,7 @@
*
* Assumptions:
*
- ********************************************************************************************/
+ ****************************************************************************/
int pthread_setschedparam(pthread_t thread, int policy, FAR const struct sched_param *param)
{
@@ -123,7 +126,7 @@ int pthread_setschedparam(pthread_t thread, int policy, FAR const struct sched_p
/* Set the errno to some non-zero value (failsafe) */
- *get_errno_ptr() = EINVAL;
+ set_errno(EINVAL);
/* Let sched_setscheduler do all of the work */
@@ -132,8 +135,8 @@ int pthread_setschedparam(pthread_t thread, int policy, FAR const struct sched_p
{
/* If sched_setscheduler() fails, return the errno */
- ret = *get_errno_ptr();
+ ret = get_errno();
}
- return ret;
- }
+ return ret;
+}