1 /* FUZZ: disable check_for_improper_main_declaration */
4 // @(#)context.c 1.1 10/18/96
26 main (int argc
, char *argv
[])
28 int ncorr
, t1arg
, t0arg
, orig_ncorr
;
34 printf ("usage: %s t0_bound t0_new_lwp t1_bound t1_new_lwp ncorr\n", argv
[0]);
49 ncorr
= atoi (argv
[5]);
51 if (thr_create (0, 0, work
, 0, t0arg
, &tid0
) != 0)
52 perror ("couldn't create thread 0");
53 if (thr_create (0, 0, work
, (void *) 1, t1arg
, &tid1
) != 0)
54 perror ("couldn't create thread 1");
56 orig_ncorr
= thr_getconcurrency ();
58 thr_setconcurrency (ncorr
);
60 rate
= (count
[0] + count
[1]) / ((float) NSLEEP
);
61 printf ("\n------------------------------------------------------------------------\n");
62 printf ("t0arg 0x%x (%s, %s, %s)\nt1arg 0x%x (%s, %s, %s)\ncount[0] %d count[1] %d\n\
63 ncorr_orig %d ncorr_set %d ncorr_end %d rate %.3f per_cxt %.2f usec\n",
65 (t0arg
& THR_DETACHED
) ? "THR_DETACHED" : "Not Detached",
66 (t0arg
& THR_BOUND
) ? "THR_BOUND" : "Not Bound",
67 (t0arg
& THR_NEW_LWP
) ? "THR_NEW_LWP" : "No New_LWP",
69 (t1arg
& THR_DETACHED
) ? "THR_DETACHED" : "Not Detached",
70 (t1arg
& THR_BOUND
) ? "THR_BOUND" : "Not Bound",
71 (t1arg
& THR_NEW_LWP
) ? "THR_NEW_LWP" : "No New_LWP",
73 orig_ncorr
, ncorr
, thr_getconcurrency (), rate
, 1.0e6
/ rate
);