MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / libc_ex6

Function libc_ex6

examples/libc/ex6.c:21–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21int libc_ex6(void) {
22 unsigned long count;
23
24 setvbuf(stdout, NULL, _IONBF, 0);
25
26 for (count = 0; count < 2000; ++count) {
27 pthread_t thread;
28 int status;
29
30 status = pthread_create(&thread, NULL, test_thread, NULL);
31 if (status != 0) {
32 printf("status = %d, count = %lu: %s\n", status, count, strerror(
33 errno));
34 return 1;
35 } else {
36 printf("count = %lu\n", count);
37 }
38 /* pthread_detach (thread); */
39 pthread_join(thread, NULL);
40 usleep(10);
41 }
42 return 0;
43}
44#include <finsh.h>
45FINSH_FUNCTION_EXPORT(libc_ex6, example 6 for libc);

Callers

nothing calls this directly

Calls 4

pthread_createFunction · 0.85
pthread_joinFunction · 0.85
printfFunction · 0.50
usleepFunction · 0.50

Tested by

no test coverage detected