mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add pthread_cond_init(3) and pthread_cond_destroy(3).
This commit is contained in:
parent
01acc81524
commit
5a96d0252f
4 changed files with 68 additions and 2 deletions
|
@ -12,6 +12,8 @@ CXXFLAGS:=$(CXXFLAGS) -Wall -Wextra -fno-exceptions -fno-rtti
|
||||||
|
|
||||||
OBJS=\
|
OBJS=\
|
||||||
pthread_cond_broadcast.o \
|
pthread_cond_broadcast.o \
|
||||||
|
pthread_cond_destroy.o \
|
||||||
|
pthread_cond_init.o \
|
||||||
pthread_cond_signal.o \
|
pthread_cond_signal.o \
|
||||||
pthread_cond_timedwait.o \
|
pthread_cond_timedwait.o \
|
||||||
pthread_cond_wait.o \
|
pthread_cond_wait.o \
|
||||||
|
|
|
@ -189,8 +189,9 @@ void pthread_initialize(void);
|
||||||
/* TODO: pthread_cleanup_pop */
|
/* TODO: pthread_cleanup_pop */
|
||||||
/* TODO: pthread_cleanup_push */
|
/* TODO: pthread_cleanup_push */
|
||||||
int pthread_cond_broadcast(pthread_cond_t*);
|
int pthread_cond_broadcast(pthread_cond_t*);
|
||||||
/* TODO: pthread_cond_destroy */
|
int pthread_cond_destroy(pthread_cond_t*);
|
||||||
/* TODO: pthread_cond_init */
|
int pthread_cond_init(pthread_cond_t* __restrict,
|
||||||
|
const pthread_condattr_t* __restrict);
|
||||||
int pthread_cond_signal(pthread_cond_t*);
|
int pthread_cond_signal(pthread_cond_t*);
|
||||||
int pthread_cond_timedwait(pthread_cond_t* __restrict,
|
int pthread_cond_timedwait(pthread_cond_t* __restrict,
|
||||||
pthread_mutex_t* __restrict,
|
pthread_mutex_t* __restrict,
|
||||||
|
|
30
libpthread/pthread_cond_destroy.c++
Normal file
30
libpthread/pthread_cond_destroy.c++
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
|
||||||
|
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||||
|
|
||||||
|
This file is part of Sortix libpthread.
|
||||||
|
|
||||||
|
Sortix libpthread is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
Sortix libpthread is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
|
License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with Sortix libpthread. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
pthread_cond_destroy.c++
|
||||||
|
Destroys a condition variable.
|
||||||
|
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
extern "C" int pthread_cond_destroy(pthread_cond_t* restrict /*cond*/)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
33
libpthread/pthread_cond_init.c++
Normal file
33
libpthread/pthread_cond_init.c++
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
|
||||||
|
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||||
|
|
||||||
|
This file is part of Sortix libpthread.
|
||||||
|
|
||||||
|
Sortix libpthread is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU Lesser General Public License as published by the
|
||||||
|
Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
Sortix libpthread is distributed in the hope that it will be useful, but
|
||||||
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
||||||
|
License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with Sortix libpthread. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
pthread_cond_init.c++
|
||||||
|
Initializes a condition variable.
|
||||||
|
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
int pthread_cond_init(pthread_cond_t* restrict cond,
|
||||||
|
const pthread_condattr_t* restrict /*attr*/)
|
||||||
|
{
|
||||||
|
*cond = PTHREAD_COND_INITIALIZER;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue