MCPcopy Create free account
hub / github.com/git/git / ut_201counter

Function ut_201counter

t/helper/test-trace2.c:383–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383static int ut_201counter(int argc, const char **argv)
384{
385 const char *usage_error =
386 "expect <v1> <v2> <threads>";
387
388 struct ut_201_data data = { 0, 0 };
389 int nr_threads = 0;
390 int k;
391 pthread_t *pids = NULL;
392
393 if (argc != 3)
394 die("%s", usage_error);
395 if (get_i(&data.v1, argv[0]))
396 die("%s", usage_error);
397 if (get_i(&data.v2, argv[1]))
398 die("%s", usage_error);
399 if (get_i(&nr_threads, argv[2]))
400 die("%s", usage_error);
401
402 CALLOC_ARRAY(pids, nr_threads);
403
404 for (k = 0; k < nr_threads; k++) {
405 if (pthread_create(&pids[k], NULL, ut_201counter_thread_proc, &data))
406 die("failed to create thread[%d]", k);
407 }
408
409 for (k = 0; k < nr_threads; k++) {
410 if (pthread_join(pids[k], NULL))
411 die("failed to join thread[%d]", k);
412 }
413
414 free(pids);
415
416 return 0;
417}
418
419static int ut_300redact_start(int argc, const char **argv)
420{

Callers

nothing calls this directly

Calls 3

pthread_createFunction · 0.85
get_iFunction · 0.70
dieFunction · 0.50

Tested by

no test coverage detected