text: /* Copyright (c) 2014 The F9 Microkernel Project. All rights reserved.
   * Use of this source code is governed by a BSD-style license that can be
   * found in the LICENSE file.
   */
  
  #ifndef __PTHREAD_H__
  #define __PTHREAD_H__
  
  #include <libposix/sys/types.h>
  
  int pthread_create(pthread_t *restrict thread,
                     const pthread_attr_t *restrict attr,
                     void *(*start_routine)(void*), void *restrict arg);
  int pthread_detach(pthread_t thread);
  void pthread_exit(void *value_ptr);
  int pthread_join(pthread_t thread, void **value_ptr);
  int pthread_mutex_init(pthread_mutex_t *mutex,
                         const pthread_mutexattr_t *restrict attr);
  int pthread_mutex_destroy(pthread_mutex_t *mutex);
  int pthread_mutex_lock(pthread_mutex_t *mutex);
  int pthread_mutex_trylock(pthread_mutex_t *mutex);
  int pthread_mutex_unlock(pthread_mutex_t *mutex);
  int pthread_mutex_timedlock(pthread_mutex_t *restrict mutex,
                              const struct timespec *restrict abstime);
  
  #endif
  