MCPcopy Create free account
hub / github.com/axboe/liburing / test

Function test

test/send_recv.c:290–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290static int test(int use_sqthread, int regfiles, int async, int provide, int vec,
291 int big_vec)
292{
293 pthread_mutexattr_t attr;
294 pthread_t recv_thread;
295 struct recv_data rd;
296 int ret;
297 void *retval;
298
299 if (vec && no_send_vec)
300 return T_EXIT_SKIP;
301
302 pthread_mutexattr_init(&attr);
303 pthread_mutexattr_setpshared(&attr, 1);
304 pthread_mutex_init(&rd.mutex, &attr);
305 pthread_mutex_lock(&rd.mutex);
306 rd.use_sqthread = use_sqthread;
307 rd.registerfiles = regfiles;
308 rd.async = async;
309 rd.provide = provide;
310
311 ret = pthread_create(&recv_thread, NULL, recv_fn, &rd);
312 if (ret) {
313 fprintf(stderr, "Thread create failed: %d\n", ret);
314 pthread_mutex_unlock(&rd.mutex);
315 return 1;
316 }
317
318 pthread_mutex_lock(&rd.mutex);
319 do_send(async, vec, big_vec);
320 pthread_join(recv_thread, &retval);
321 return (intptr_t)retval;
322}
323
324static int test_invalid(void)
325{

Callers 1

mainFunction · 0.70

Calls 1

do_sendFunction · 0.70

Tested by

no test coverage detected