diff options
author | Rudy Bousset <rbousset@z2r5p1.le-101.fr> | 2020-03-04 20:27:51 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p1.le-101.fr> | 2020-03-04 20:27:51 +0100 |
commit | 073aca54bf8e3a20eba04cb4c26dc35ec43785e7 (patch) | |
tree | 77d22ad3456917af18f83c6a453850eb39674433 /src/ft_warp_level.c | |
parent | Correct (diff) | |
download | 42-cub3d-073aca54bf8e3a20eba04cb4c26dc35ec43785e7.tar.gz 42-cub3d-073aca54bf8e3a20eba04cb4c26dc35ec43785e7.tar.bz2 42-cub3d-073aca54bf8e3a20eba04cb4c26dc35ec43785e7.tar.xz 42-cub3d-073aca54bf8e3a20eba04cb4c26dc35ec43785e7.tar.zst 42-cub3d-073aca54bf8e3a20eba04cb4c26dc35ec43785e7.zip |
Music on macOS is half bav
Diffstat (limited to '')
-rw-r--r-- | src/ft_warp_level.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index b122e46..a93184c 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -16,6 +16,7 @@ #include <stddef.h> #include <stdint.h> #include <mlx.h> +#include <signal.h> #include <pthread.h> static void @@ -66,14 +67,20 @@ static void if (isoldmus && !cl->mlist.ismusic) { pthread_cancel(cl->tid); - pthread_join(cl->tid, NULL); + if (FT_OS == 1) + pthread_kill(cl->tid, SIGTERM); + else + pthread_join(cl->tid, NULL); cl->isoldmus = 0; } else if (isoldmus && cl->mlist.ismusic && ft_strncmp(tmp_mup, cl->mlist.music_path, ft_strlen(tmp_mup) + 1)) { pthread_cancel(cl->tid); - pthread_join(cl->tid, NULL); + if (FT_OS == 1) + pthread_kill(cl->tid, SIGTERM); + else + pthread_join(cl->tid, NULL); pthread_create(&cl->tid, NULL, ft_music_thread, cl); } else if (isoldmus && cl->mlist.ismusic |