X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/0c60e90bdf1a75402f9cc86eb300c5619dd895bc..b3c271b232e8f73e50efb422b844167550267024:/rtems/gw/cangw/gw.c diff --git a/rtems/gw/cangw/gw.c b/rtems/gw/cangw/gw.c index 87dc756..2e56fb4 100644 --- a/rtems/gw/cangw/gw.c +++ b/rtems/gw/cangw/gw.c @@ -133,8 +133,9 @@ static int start_tasks(){ return 1; } -// pthread_detach(CAN_B_to_A_thread); -// pthread_detach(CAN_A_to_B_thread); + /* detach is needed so that the threads call clean up handlers automatically. */ + pthread_detach(CAN_B_to_A_thread); + pthread_detach(CAN_A_to_B_thread); /* Threads are started and running at this point. */ return 0; @@ -170,13 +171,13 @@ static int end_tasks(){ printf("Attempting to stop thread 1\n"); res = pthread_cancel(CAN_A_to_B_thread); if (res != 0){ - printf("Failed./n"); + printf("Failed.\n"); /* Not sure what to do with error here, will have to figure out later. */ } printf("Attempting to stop thread 2\n"); res = pthread_cancel(CAN_B_to_A_thread); if (res != 0){ - printf("Failed./n"); + printf("Failed.\n"); /* Not sure what to do with error here, will have to figure out later. */ } sleep(1);