Lines Matching refs:fn
85 extern "C" void RunThread(void (*fn)()) {
86 (*fn)();
89 extern "C" void RunManyThreads(void (*fn)(), int count) {
90 // I guess the best we can do is run fn sequentially, 'count' times
92 (*fn)();
95 extern "C" void RunManyThreadsWithId(void (*fn)(int), int count, int) {
97 (*fn)(i); // stacksize doesn't make sense in a non-threaded context
110 (**static_cast<void (**)()>(ptr_to_ptr_to_fn))(); // runs fn
116 (*fn_and_id->ptr_to_function)(fn_and_id->id); // runs fn
120 void RunManyThreads(void (*fn)(), int count) {
124 hThread[i] = CreateThread(NULL, 0, RunFunctionInThread, &fn, 0, &dummy);
134 void RunThread(void (*fn)()) {
135 RunManyThreads(fn, 1);
138 void RunManyThreadsWithId(void (*fn)(int), int count, int stacksize) {
143 fn_and_ids[i].ptr_to_function = fn;
167 (**static_cast<void (**)()>(ptr_to_ptr_to_fn))(); // runs fn
173 (*fn_and_id->ptr_to_function)(fn_and_id->id); // runs fn
181 void RunThread(void (*fn)()) {
183 // Even though fn is on the stack, it's safe to pass a pointer to it,
185 SAFE_PTHREAD(pthread_create(&thr, NULL, RunFunctionInThread, &fn));
189 void RunManyThreads(void (*fn)(), int count) {
192 SAFE_PTHREAD(pthread_create(&thr[i], NULL, RunFunctionInThread, &fn));
200 void RunManyThreadsWithId(void (*fn)(int), int count, int stacksize) {
208 fn_and_ids[i].ptr_to_function = fn;