Implement POSIX threads API

This commit is contained in:
Justine Tunney 2022-09-05 08:26:03 -07:00
parent af24f21556
commit 9be364d40a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
95 changed files with 6029 additions and 317 deletions

View file

@ -21,12 +21,11 @@
/**
* Initializes mutex.
* @param attr may be NULL
*
* @param attr may be null
* @return 0 on success, or error number on failure
*/
int(pthread_mutex_init)(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr) {
bzero(mutex, sizeof(*mutex));
mutex->attr = attr ? attr->attr : PTHREAD_MUTEX_DEFAULT;
return 0;
return pthread_mutex_init(mutex, attr);
}