From 6726e519204ef45a86a5613a38ab639d4f2907ad Mon Sep 17 00:00:00 2001
From: Jieun <yjeka@ajou.ac.kr>
Date: Fri, 14 Aug 2020 22:27:46 +0900
Subject: [PATCH] Fix main.c

---
 08_14_mutex/ledThreads/led_main.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/08_14_mutex/ledThreads/led_main.c b/08_14_mutex/ledThreads/led_main.c
index 26fbdc9..8134e1f 100644
--- a/08_14_mutex/ledThreads/led_main.c
+++ b/08_14_mutex/ledThreads/led_main.c
@@ -31,21 +31,18 @@ int main(int argc, char *argv[])
         wiringPiSetup();
         
         if (gno == 1) {
-            led_red_task();
             if (pthread_create(&tid_G, NULL, led_green_task, (void*)count) != 0)
             {
                 perror("pthread_create");
                 exit(1);
             }
         } else if (gno == 2) {
-            led_red_task();
             if (pthread_create(&tid_Y, NULL, led_yellow_task, (void*)count) != 0)
             {
                 perror("pthread_create");
                 exit(1);
             }
         } else if(gno == 3){
-            led_red_task();
             if (pthread_create(&tid_Y, NULL, led_yellow_task, (void*)count) != 0)
             {
                 perror("pthread_create");
@@ -57,11 +54,8 @@ int main(int argc, char *argv[])
                 exit(1);
             }
         }
+        led_red_task();
     }
     pthread_exit(NULL);
     return 0;
-}
-
-
-
-
+}
\ No newline at end of file
-- 
GitLab