aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r--src/ft_exit.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 6d93f8e..4f2494b 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
+#include <signal.h>
static void
ft_del_last_remains(t_cub *clist)
@@ -45,15 +46,25 @@ static void
if (clist->isoldmus && clist->wlist.inited)
{
- pthread_cancel(clist->mtid);
- pthread_join(clist->mtid, NULL);
+ if (FT_OS == 2)
+ {
+ pthread_cancel(clist->mtid);
+ pthread_join(clist->mtid, NULL);
+ }
+ else
+ system(FT_SND_TERM_CMD);
}
i = -1;
while (++i < FT_TOTAL_SFX)
{
pthread_mutex_unlock(&clist->sfx[i].mutex);
- pthread_cancel(clist->sfx[i].tid);
- pthread_join(clist->sfx[i].tid, NULL);
+ if (FT_OS == 2)
+ {
+ pthread_cancel(clist->sfx[i].tid);
+ pthread_join(clist->sfx[i].tid, NULL);
+ }
+ else
+ system(FT_SND_TERM_CMD);
}
}