tgrekov-philosophers
HIVE philosophers July 2024
Loading...
Searching...
No Matches
setup.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* setup.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/02 07:21:43 by tgrekov #+# #+# */
/* Updated: 2024/08/02 07:39:01 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file setup.c.

#include <stdlib.h>
#include "../philosopher/philo.h"
Include dependency graph for setup.c:

Go to the source code of this file.

Functions

static int allocate (t_global *global, t_thread **thread)
 Allocate fork and thread arrays.
 
static int initialize (t_global *global, t_thread *thread)
 Initialize forks and eating quota mutexes.
 
int setup (t_global *global, t_thread **thread)
 Allocate fork array and thread structure, initialize mutexes.
 

Function Documentation

◆ allocate()

static int allocate ( t_global global,
t_thread **  thread 
)
static

Allocate fork and thread arrays.

Parameters
global
thread
Return values
int

Definition at line 30 of file setup.c.

Here is the caller graph for this function:

◆ initialize()

static int initialize ( t_global global,
t_thread thread 
)
static

Initialize forks and eating quota mutexes.

Parameters
global
thread
Return values
int

Definition at line 49 of file setup.c.

Here is the caller graph for this function:

◆ setup()

int setup ( t_global global,
t_thread **  thread 
)

Allocate fork array and thread structure, initialize mutexes.

Parameters
global
thread
Return values
int

Definition at line 84 of file setup.c.

References allocate(), and initialize().

Here is the call graph for this function:
Here is the caller graph for this function: