A const storage class to to phthread parameters. From Freddie Chopin

This commit is contained in:
Gregory Nutt 2014-09-08 06:21:48 -06:00
parent f24072a91b
commit e953fb11cd
9 changed files with 18 additions and 18 deletions

View File

@ -255,10 +255,10 @@ int pthread_attr_destroy(pthread_attr_t *attr);
/* Set or obtain the default scheduling algorithm */
int pthread_attr_setschedpolicy(FAR pthread_attr_t *attr, int policy);
int pthread_attr_getschedpolicy(FAR pthread_attr_t *attr, int *policy);
int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy);
int pthread_attr_setschedparam(FAR pthread_attr_t *attr,
FAR const struct sched_param *param);
int pthread_attr_getschedparam(FAR pthread_attr_t *attr,
int pthread_attr_getschedparam(FAR const pthread_attr_t *attr,
FAR struct sched_param *param);
int pthread_attr_setinheritsched(FAR pthread_attr_t *attr,
int inheritsched);
@ -268,7 +268,7 @@ int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
/* Set or obtain the default stack size */
int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
int pthread_attr_getstacksize(FAR pthread_attr_t *attr, long *stackaddr);
int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, long *stackaddr);
/* To create a thread object and runnable thread, a routine must be specified
* as the new thread's start routine. An argument may be passed to this
@ -277,7 +277,7 @@ int pthread_attr_getstacksize(FAR pthread_attr_t *attr, long *stackaddr);
* about the kind of thread being created.
*/
int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
pthread_startroutine_t startroutine, pthread_addr_t arg);
/* A thread object may be "detached" to specify that the return value and
@ -325,7 +325,7 @@ int pthread_setschedprio(pthread_t thread, int prio);
int pthread_key_create(FAR pthread_key_t *key,
CODE void (*destructor)(FAR void*));
int pthread_setspecific(pthread_key_t key, FAR void *value);
int pthread_setspecific(pthread_key_t key, FAR const void *value);
FAR void *pthread_getspecific(pthread_key_t key);
int pthread_key_delete(pthread_key_t key);
@ -333,7 +333,7 @@ int pthread_key_delete(pthread_key_t key);
int pthread_mutexattr_init(FAR pthread_mutexattr_t *attr);
int pthread_mutexattr_destroy(FAR pthread_mutexattr_t *attr);
int pthread_mutexattr_getpshared(FAR pthread_mutexattr_t *attr,
int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr,
FAR int *pshared);
int pthread_mutexattr_setpshared(FAR pthread_mutexattr_t *attr,
int pshared);
@ -345,7 +345,7 @@ int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
/* The following routines create, delete, lock and unlock mutexes. */
int pthread_mutex_init(FAR pthread_mutex_t *mutex,
FAR pthread_mutexattr_t *attr);
FAR const pthread_mutexattr_t *attr);
int pthread_mutex_destroy(FAR pthread_mutex_t *mutex);
int pthread_mutex_lock(FAR pthread_mutex_t *mutex);
int pthread_mutex_trylock(FAR pthread_mutex_t *mutex);
@ -358,7 +358,7 @@ int pthread_condattr_destroy(FAR pthread_condattr_t *attr);
/* A thread can create and delete condition variables. */
int pthread_cond_init(FAR pthread_cond_t *cond, FAR pthread_condattr_t *attr);
int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *attr);
int pthread_cond_destroy(FAR pthread_cond_t *cond);
/* A thread can signal to and broadcast on a condition variable. */

View File

@ -85,7 +85,7 @@
*
****************************************************************************/
int pthread_attr_getschedparam(FAR pthread_attr_t *attr,
int pthread_attr_getschedparam(FAR const pthread_attr_t *attr,
FAR struct sched_param *param)
{
int ret;

View File

@ -84,7 +84,7 @@
*
****************************************************************************/
int pthread_attr_getschedpolicy(FAR pthread_attr_t *attr, int *policy)
int pthread_attr_getschedpolicy(FAR const pthread_attr_t *attr, int *policy)
{
int ret;

View File

@ -83,7 +83,7 @@
*
****************************************************************************/
int pthread_attr_getstacksize(FAR pthread_attr_t *attr, FAR long *stacksize)
int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR long *stacksize)
{
int ret;

View File

@ -84,7 +84,7 @@
*
****************************************************************************/
int pthread_mutexattr_getpshared(FAR pthread_mutexattr_t *attr, FAR int *pshared)
int pthread_mutexattr_getpshared(FAR const pthread_mutexattr_t *attr, FAR int *pshared)
{
int ret = OK;

View File

@ -65,7 +65,7 @@
*
****************************************************************************/
int pthread_cond_init(FAR pthread_cond_t *cond, FAR pthread_condattr_t *attr)
int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *attr)
{
int ret = OK;

View File

@ -228,7 +228,7 @@ static void pthread_start(void)
*
****************************************************************************/
int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
pthread_startroutine_t start_routine, pthread_addr_t arg)
{
FAR struct pthread_tcb_s *ptcb;
@ -245,7 +245,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
if (!attr)
{
attr = (FAR pthread_attr_t *)&g_default_pthread_attr;
attr = &g_default_pthread_attr;
}
/* Allocate a TCB for the new task. */

View File

@ -86,7 +86,7 @@
*
****************************************************************************/
int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR pthread_mutexattr_t *attr)
int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t *attr)
{
int pshared = 0;
#ifdef CONFIG_MUTEX_TYPES

View File

@ -112,7 +112,7 @@
*
****************************************************************************/
int pthread_setspecific(pthread_key_t key, FAR void *value)
int pthread_setspecific(pthread_key_t key, FAR const void *value)
{
#if CONFIG_NPTHREAD_KEYS > 0
FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s*)g_readytorun.head;
@ -128,7 +128,7 @@ int pthread_setspecific(pthread_key_t key, FAR void *value)
{
/* Store the data in the TCB. */
rtcb->pthread_data[key] = value;
rtcb->pthread_data[key] = (FAR void*)value;
/* Return success. */