diff --git a/Documentation b/Documentation index 0ac15c4ce3c..5a5b086ac14 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 0ac15c4ce3c71f25aa923eebb0529dd571850f4a +Subproject commit 5a5b086ac14ebab6619e53e15b8e4801142dec58 diff --git a/libc/pthread/pthread_attrsetschedpolicy.c b/libc/pthread/pthread_attrsetschedpolicy.c index d7bb1ff5c44..76e774e2506 100644 --- a/libc/pthread/pthread_attrsetschedpolicy.c +++ b/libc/pthread/pthread_attrsetschedpolicy.c @@ -1,7 +1,7 @@ /**************************************************************************** * libc/pthread/pthread_attrsetschedpolicy.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,26 +45,6 @@ #include #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -92,11 +72,15 @@ int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy) sdbg("attr=0x%p policy=%d\n", attr, policy); + if (!attr || + (policy != SCHED_FIFO #if CONFIG_RR_INTERVAL > 0 - if (!attr || (policy != SCHED_FIFO && policy != SCHED_RR)) -#else - if (!attr || policy != SCHED_FIFO ) + && policy != SCHED_RR #endif +#ifdef CONFIG_SCHED_SPORADIC + && policy != SCHED_SPORADIC +#endif + )) { ret = EINVAL; } diff --git a/sched/sched/sched_rrgetinterval.c b/sched/sched/sched_rrgetinterval.c index 9070fb88c24..bb8a0152a20 100644 --- a/sched/sched/sched_rrgetinterval.c +++ b/sched/sched/sched_rrgetinterval.c @@ -48,30 +48,6 @@ #include "sched/sched.h" #include "clock/clock.h" -/************************************************************************ - * Pre-processor Definitions - ************************************************************************/ - -/************************************************************************ - * Private Type Declarations - ************************************************************************/ - -/************************************************************************ - * Global Variables - ************************************************************************/ - -/************************************************************************ - * Private Variables - ************************************************************************/ - -/************************************************************************ - * Private Function Prototypes - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ - /************************************************************************ * Public Functions ************************************************************************/ @@ -126,7 +102,7 @@ int sched_rr_get_interval(pid_t pid, struct timespec *interval) return ERROR; } - /* Otherwise, lookup the TCB associated with this pid */ + /* Otherwise, lookup the TCB associated with this PID */ else {