pthreads: Move pthread_cond_init and pthread_cond_destory from sched/pthreads to libc/pthreads. This just coordinate other OS interface calls but are not a fundamental OS interfaces and, hence, do not belong within the OS.

This commit is contained in:
Gregory Nutt 2017-06-14 07:48:45 -06:00
parent 557fd6504f
commit ae168bffa0
9 changed files with 25 additions and 34 deletions

View File

@ -401,29 +401,27 @@
# define SYS_pthread_barrier_wait (__SYS_pthread+2)
# define SYS_pthread_cancel (__SYS_pthread+3)
# define SYS_pthread_cond_broadcast (__SYS_pthread+4)
# define SYS_pthread_cond_destroy (__SYS_pthread+5)
# define SYS_pthread_cond_init (__SYS_pthread+6)
# define SYS_pthread_cond_signal (__SYS_pthread+7)
# define SYS_pthread_cond_wait (__SYS_pthread+8)
# define SYS_pthread_create (__SYS_pthread+9)
# define SYS_pthread_detach (__SYS_pthread+10)
# define SYS_pthread_exit (__SYS_pthread+11)
# define SYS_pthread_getschedparam (__SYS_pthread+12)
# define SYS_pthread_getspecific (__SYS_pthread+13)
# define SYS_pthread_join (__SYS_pthread+14)
# define SYS_pthread_key_create (__SYS_pthread+15)
# define SYS_pthread_key_delete (__SYS_pthread+16)
# define SYS_pthread_mutex_destroy (__SYS_pthread+17)
# define SYS_pthread_mutex_init (__SYS_pthread+18)
# define SYS_pthread_mutex_lock (__SYS_pthread+19)
# define SYS_pthread_mutex_trylock (__SYS_pthread+20)
# define SYS_pthread_mutex_unlock (__SYS_pthread+21)
# define SYS_pthread_cond_signal (__SYS_pthread+5)
# define SYS_pthread_cond_wait (__SYS_pthread+6)
# define SYS_pthread_create (__SYS_pthread+7)
# define SYS_pthread_detach (__SYS_pthread+8)
# define SYS_pthread_exit (__SYS_pthread+9)
# define SYS_pthread_getschedparam (__SYS_pthread+10)
# define SYS_pthread_getspecific (__SYS_pthread+11)
# define SYS_pthread_join (__SYS_pthread+12)
# define SYS_pthread_key_create (__SYS_pthread+13)
# define SYS_pthread_key_delete (__SYS_pthread+14)
# define SYS_pthread_mutex_destroy (__SYS_pthread+15)
# define SYS_pthread_mutex_init (__SYS_pthread+16)
# define SYS_pthread_mutex_lock (__SYS_pthread+17)
# define SYS_pthread_mutex_trylock (__SYS_pthread+18)
# define SYS_pthread_mutex_unlock (__SYS_pthread+19)
#ifndef CONFIG_PTHREAD_MUTEX_UNSAFE
# define SYS_pthread_mutex_consistent (__SYS_pthread+22)
# define __SYS_pthread_setschedparam (__SYS_pthread+23)
# define SYS_pthread_mutex_consistent (__SYS_pthread+20)
# define __SYS_pthread_setschedparam (__SYS_pthread+21)
#else
# define __SYS_pthread_setschedparam (__SYS_pthread+22)
# define __SYS_pthread_setschedparam (__SYS_pthread+20)
#endif
# define SYS_pthread_setschedparam (__SYS_pthread_setschedparam+0)

View File

@ -111,6 +111,8 @@
"pthread_barrierattr_setpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrierattr_t *","int"
"pthread_condattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *"
"pthread_condattr_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_condattr_t *"
"pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*"
"pthread_cond_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR const pthread_condattr_t*"
"pthread_mutexattr_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *"
"pthread_mutexattr_getpshared","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_mutexattr_t *","FAR int *"
"pthread_mutexattr_gettype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","FAR const pthread_mutexattr_t *","int *"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -45,6 +45,7 @@ CSRCS += pthread_attr_setschedparam.c pthread_attr_getschedparam.c
CSRCS += pthread_barrierattr_init.c pthread_barrierattr_destroy.c
CSRCS += pthread_barrierattr_getpshared.c pthread_barrierattr_setpshared.c
CSRCS += pthread_condattr_init.c pthread_condattr_destroy.c
CSRCS += pthread_condinit.c pthread_conddestroy.c
CSRCS += pthread_mutexattr_init.c pthread_mutexattr_destroy.c
CSRCS += pthread_mutexattr_getpshared.c pthread_mutexattr_setpshared.c
CSRCS += pthread_mutexattr_setprotocol.c pthread_mutexattr_getprotocol.c

View File

@ -1,7 +1,7 @@
/****************************************************************************
* sched/pthread/pthread_conddestroy.c
* libc/pthread/pthread_conddestroy.c
*
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -42,7 +42,6 @@
#include <pthread.h>
#include <debug.h>
#include <errno.h>
#include "pthread/pthread.h"
/****************************************************************************
* Public Functions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* sched/pthread/pthread_condinit.c
* libc/pthread/pthread_condinit.c
*
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -46,8 +46,6 @@
#include <nuttx/semaphore.h>
#include "pthread/pthread.h"
/****************************************************************************
* Public Functions
****************************************************************************/

View File

@ -39,7 +39,6 @@ CSRCS += pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c
CSRCS += pthread_getschedparam.c pthread_setschedparam.c
CSRCS += pthread_mutexinit.c pthread_mutexdestroy.c
CSRCS += pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c
CSRCS += pthread_condinit.c pthread_conddestroy.c
CSRCS += pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c
CSRCS += pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c
CSRCS += pthread_cancel.c

View File

@ -72,8 +72,6 @@
"pthread_cleanup_pop","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","int"
"pthread_cleanup_push","pthread.h","defined(CONFIG_PTHREAD_CLEANUP)","void","pthread_cleanup_t","FAR void*"
"pthread_cond_broadcast","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*"
"pthread_cond_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*"
"pthread_cond_init","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR const pthread_condattr_t*"
"pthread_cond_signal","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*"
"pthread_cond_timedwait","pthread.h","!defined(CONFIG_DISABLE_SIGNALS) && !defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR pthread_mutex_t*","FAR const struct timespec*"
"pthread_cond_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t*","FAR pthread_mutex_t*"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -286,8 +286,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(pthread_barrier_wait, 1, STUB_pthread_barrier_wait)
SYSCALL_LOOKUP(pthread_cancel, 1, STUB_pthread_cancel)
SYSCALL_LOOKUP(pthread_cond_broadcast, 1, STUB_pthread_cond_broadcast)
SYSCALL_LOOKUP(pthread_cond_destroy, 1, STUB_pthread_cond_destroy)
SYSCALL_LOOKUP(pthread_cond_init, 2, STUB_pthread_cond_init)
SYSCALL_LOOKUP(pthread_cond_signal, 1, STUB_pthread_cond_signal)
SYSCALL_LOOKUP(pthread_cond_wait, 2, STUB_pthread_cond_wait)
SYSCALL_LOOKUP(pthread_create, 4, STUB_pthread_create)

View File

@ -281,8 +281,6 @@ uintptr_t STUB_pthread_barrier_init(int nbr, uintptr_t parm1,
uintptr_t STUB_pthread_barrier_wait(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_cancel(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_cond_broadcast(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_cond_destroy(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_cond_init(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_pthread_cond_signal(int nbr, uintptr_t parm1);
uintptr_t STUB_pthread_cond_wait(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_pthread_create(int nbr, uintptr_t parm1, uintptr_t parm2,