| 59 | } |
| 60 | |
| 61 | int * receive_1(void * mq) |
| 62 | { |
| 63 | int i; |
| 64 | mqd_t mq1 = *(mqd_t *)mq; |
| 65 | |
| 66 | printf("Enter into receive_1 \n"); |
| 67 | for (i = 0; i< MAX_MSG; i++) { |
| 68 | if ( -1 == mq_receive(mq1, r_msg_ptr_1[i], MSG_SIZE, NULL) ) { |
| 69 | perror("mq_receive doesn't return success \n"); |
| 70 | pthread_exit((void *)1); |
| 71 | } |
| 72 | printf("[%d] receive '%s' in thread receive_1. \n", i+1, r_msg_ptr_1[i]); |
| 73 | } |
| 74 | pthread_exit((void *)0); |
| 75 | } |
| 76 | int * receive_2(void * mq) |
| 77 | { |
| 78 | int i; |
nothing calls this directly
no test coverage detected