MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / asdf

Method asdf

thread/thread11.h:137–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 static long any_return_type(int, char) { return 0; }
136
137 void asdf()
138 {
139 int a = 0; char b = 0;
140 auto func = &__Example_of_Thread11__::member_function;
141 auto cfunc = &__Example_of_Thread11__::const_member_function;
142
143 // thread { return this->func(a, b); }
144 thread_create11(func, this, a, b);
145
146 // thread { return this->cfunc(a, b, 3.14); }
147 thread_create11(cfunc, this, a, b, 3.14);
148
149 // thread(stack_size = 64KB) { return this->func(1, 'a'); }
150 thread_create11(/* stack size */ 256*1024, func, this, 1, 'a');
151
152 // thread { any_return_type(a, b); return nullptr; }
153 thread_create11(&any_return_type, a, b);
154
155 // thread(stack_size = 64KB) { any_return_type(1, 'a'); return nullptr; }
156 thread_create11(/* stack size */ 256*1024, &any_return_type, 1, 'a');
157
158 thread_create11([&](int, double) { return -1; }, 10, 3.1415926);
159
160 thread_yield();
161 }
162 };
163}

Callers 1

TESTFunction · 0.45

Calls 2

thread_yieldFunction · 0.85
thread_create11Function · 0.70

Tested by 1

TESTFunction · 0.36