]> git.saurik.com Git - apple/objc4.git/blob - test/load-parallel0.m
objc4-437.tar.gz
[apple/objc4.git] / test / load-parallel0.m
1 #ifndef N
2 #error -DN=n missing
3 #endif
4
5 #include <stdio.h>
6 #include <sched.h>
7 #include <unistd.h>
8 #include <libkern/OSAtomic.h>
9 extern int state;
10
11 #define CLASS0(n,nn) \
12 @interface C_##n##_##nn @end \
13 @implementation C_##n##_##nn \
14 +(void)load { OSAtomicIncrement32(&state); usleep(10); } \
15 @end
16
17 #define CLASS(n,nn) CLASS0(n,nn)
18
19 CLASS(a,N)
20 CLASS(b,N)
21 CLASS(c,N)
22 CLASS(d,N)
23 CLASS(e,N)
24 CLASS(f,N)
25 CLASS(g,N)
26 CLASS(h,N)
27 CLASS(i,N)
28 CLASS(j,N)
29 CLASS(k,N)
30 CLASS(l,N)
31 CLASS(m,N)
32 CLASS(n,N)
33 CLASS(o,N)
34 CLASS(p,N)
35 CLASS(q,N)
36 CLASS(r,N)
37 CLASS(s,N)
38 CLASS(t,N)
39 CLASS(u,N)
40 CLASS(v,N)
41 CLASS(w,N)
42 CLASS(x,N)
43 CLASS(y,N)
44 CLASS(z,N)