tgrekov-philosophers
HIVE philosophers July 2024
|
Definition in file philo.h.
#include <pthread.h>
Go to the source code of this file.
Data Structures | |
struct | s_opt |
struct | t_global |
struct | s_thread |
Functions | |
int | philo_sleep (unsigned long ms, t_thread *thread) |
Sleep in 200 microsecond intervals until ms millis have elapsed, or stop has returned non-zero. | |
int | status (t_thread *thread, char *str, int ignore_end) |
Thread safe philosopher state logging. | |
int | check_end (t_global *global) |
Check if the simulation has ended. | |
int | stop (t_thread *thread) |
Determine if this thread's philo should die, or if the thread has reported an error. | |
int check_end | ( | t_global * | global | ) |
int philo_sleep | ( | unsigned long | ms, |
t_thread * | thread | ||
) |
Sleep in 200 microsecond intervals until ms
millis have elapsed, or stop
has returned non-zero.
ms | Milliseconds to sleep |
thread |
int |
Definition at line 33 of file philo_sleep.c.
References check_end(), stop(), and timestamp().
int status | ( | t_thread * | thread, |
char * | str, | ||
int | ignore_end | ||
) |
Thread safe philosopher state logging.
thread | |
str | |
ignore_end |
int |
Definition at line 46 of file status.c.
References check_end(), status_print_verify(), and timestamp().
int stop | ( | t_thread * | thread | ) |
Determine if this thread's philo should die, or if the thread has reported an error.
thread |
int |
Definition at line 30 of file stop.c.
References status(), and timestamp().