aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--philo_one/src/main.c4
-rw-r--r--philo_one/src/philo_one.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/philo_one/src/main.c b/philo_one/src/main.c
index e2dabbc..240cc4f 100644
--- a/philo_one/src/main.c
+++ b/philo_one/src/main.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/24 05:53:02 by cacharle #+# #+# */
-/* Updated: 2021/01/12 12:53:27 by cacharle ### ########.fr */
+/* Updated: 2021/01/15 22:40:50 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -29,6 +29,7 @@ static int st_destroy(
static void *st_routine_flush(t_philo_conf *conf)
{
+ pthread_mutex_unlock(&conf->mutex_stdout); // ???????????????
while (true)
{
pthread_mutex_lock(&conf->mutex_stdout);
@@ -36,6 +37,7 @@ static void *st_routine_flush(t_philo_conf *conf)
pthread_mutex_unlock(&conf->mutex_stdout);
usleep(250000);
}
+ return (NULL);
}
static int st_setup(
diff --git a/philo_one/src/philo_one.h b/philo_one/src/philo_one.h
index a327d2e..1cfecae 100644
--- a/philo_one/src/philo_one.h
+++ b/philo_one/src/philo_one.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/24 06:11:16 by cacharle #+# #+# */
-/* Updated: 2021/01/10 12:00:35 by cacharle ### ########.fr */
+/* Updated: 2021/01/15 22:43:00 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -38,9 +38,11 @@ typedef struct
bool all_alive;
long int meal_num_finished_counter;
t_time initial_time;
- pthread_mutex_t mutex_stdout;
pthread_mutex_t mutex_meal_num_finished_counter;
pthread_mutex_t *forks;
+ long int padding4; // ???????????????
+ long int padding3;
+ pthread_mutex_t mutex_stdout;
} t_philo_conf;
typedef struct s_philo
@@ -51,7 +53,6 @@ typedef struct s_philo
t_philo_conf *conf;
pthread_mutex_t *fork_left;
pthread_mutex_t *fork_right;
- pthread_mutex_t *mutex_stdout;
pthread_mutex_t mutex_start;
pthread_mutex_t mutex_eat;
} t_philo;