MCPcopy Create free account
hub / github.com/acl-dev/acl / test_thread

Function test_thread

lib_acl_cpp/samples/thread/main.cpp:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28//////////////////////////////////////////////////////////////////////////
29
30static void test_thread(void)
31{
32 const char* myname = "test_thread";
33 mythread thr;
34
35 thr.set_detachable(false);
36 if (thr.start() == false)
37 {
38 printf("start thread failed\r\n");
39 return;
40 }
41
42 printf("%s: thread id is %lu, main thread id: %lu\r\n",
43 myname, thr.thread_id(), acl::thread::thread_self());
44
45 printf("begin wait for thread exit\r\n");
46 if (thr.wait(NULL) == false)
47 printf("wait thread failed\r\n");
48 else
49 printf("wait thread ok\r\n");
50}
51
52static void test_thread2(void)
53{

Callers 1

mainFunction · 0.70

Calls 4

thread_selfFunction · 0.85
thread_idMethod · 0.80
startMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…