| 105 | } |
| 106 | |
| 107 | int libc_ex2(void) |
| 108 | { |
| 109 | pthread_t th_a, th_b; |
| 110 | void * retval; |
| 111 | |
| 112 | init(&buffer); |
| 113 | /* Create the threads */ |
| 114 | pthread_create(&th_a, NULL, producer, 0); |
| 115 | pthread_create(&th_b, NULL, consumer, 0); |
| 116 | /* Wait until producer and consumer finish. */ |
| 117 | pthread_join(th_a, &retval); |
| 118 | pthread_join(th_b, &retval); |
| 119 | return 0; |
| 120 | } |
| 121 | #include <finsh.h> |
| 122 | FINSH_FUNCTION_EXPORT(libc_ex2, example 2 for libc); |
nothing calls this directly
no test coverage detected