mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
A const storage class to to phthread parameters. From Freddie Chopin
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user