ft_thread_mutex_lock,(1)

NAME
ft_thread_mutex_lock, ft_thread_mutex_unlock - mutexes for fair threads

  SYNOPSIS

#include <fthread.h>
int ft_thread_mutex_lock   (pthread_mutex_t *mutex);
int ft_thread_mutex_unlock (pthread_mutex_t *mutex);

  DESCRIPTION
For unlinked threads, ft_thread_mutex_lock is like pthread_mutex_lock and ft_thread_mutex_unlock is like pthread_mutex_unlock.

 For linked threads, ft_thread_mutex_lock suspends the calling thread until mutex can be locked. Thus, while mutex is unavailable, other threads in the scheduler can continue to run (this would not be the case if pthread_mutex_lock where used instead of ft_thread_mutex_lock). All locks owned by a thread are automatically released when it terminates or when it is stopped.

  RETURN VALUES
On success ft_thread_mutex_lock and ft_thread_mutex_unlock both return the value 0. On error, a non-zero error code is returned.

  ERRORS
Errors returned are the ones returned by pthread_mutex_lock and pthread_mutex_unlock.

  SEE ALSO
ft_thread_link (3), ft_thread_unlink (3).

AUTHOR