mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add pthread_rwlockattr_init(3) and pthread_rwlockattr_destroy(3).
This commit is contained in:
parent
466091bc4f
commit
978aa68906
4 changed files with 73 additions and 3 deletions
|
@ -125,7 +125,15 @@ typedef struct
|
|||
} __pthread_rwlock_t;
|
||||
#endif
|
||||
|
||||
typedef int __pthread_rwlockattr_t;
|
||||
#if defined(__is_sortix_libpthread)
|
||||
typedef struct
|
||||
{
|
||||
} __pthread_rwlockattr_t;
|
||||
#else
|
||||
typedef struct
|
||||
{
|
||||
} __pthread_rwlockattr_t;
|
||||
#endif
|
||||
|
||||
typedef int __pthread_spinlock_t;
|
||||
|
||||
|
|
|
@ -250,9 +250,9 @@ int pthread_rwlock_tryrdlock(pthread_rwlock_t*);
|
|||
int pthread_rwlock_trywrlock(pthread_rwlock_t*);
|
||||
int pthread_rwlock_unlock(pthread_rwlock_t*);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t*);
|
||||
/* TODO: pthread_rwlockattr_destroy */
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t*);
|
||||
/* TODO: pthread_rwlockattr_getpshared */
|
||||
/* TODO: pthread_rwlockattr_init */
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t*);
|
||||
/* TODO: pthread_rwlockattr_setpshared */
|
||||
pthread_t pthread_self(void);
|
||||
/* TODO: pthread_setcancelstate */
|
||||
|
|
30
libpthread/pthread_rwlockattr_destroy.c++
Normal file
30
libpthread/pthread_rwlockattr_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_rwlockattr_destroy.c++
|
||||
Destroys a read-write lock attributes object.
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
extern "C" int pthread_rwlockattr_destroy(pthread_rwlockattr_t* /*attr*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
32
libpthread/pthread_rwlockattr_init.c++
Normal file
32
libpthread/pthread_rwlockattr_init.c++
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*******************************************************************************
|
||||
|
||||
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_rwlockattr_init.c++
|
||||
Initialize a read-write lock attributes object.
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" int pthread_rwlockattr_init(pthread_rwlockattr_t* attr)
|
||||
{
|
||||
memset(attr, 0, sizeof(*attr));
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue