3 $C{COMPILE} $DIR/concurrentcat.m -o concurrentcat.exe -framework Foundation
5 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc1 -o cc1.bundle
6 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc2 -o cc2.bundle
7 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc3 -o cc3.bundle
8 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc4 -o cc4.bundle
9 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc5 -o cc5.bundle
10 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc6 -o cc6.bundle
11 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc7 -o cc7.bundle
12 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc8 -o cc8.bundle
13 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc9 -o cc9.bundle
14 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc10 -o cc10.bundle
15 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc11 -o cc11.bundle
16 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc12 -o cc12.bundle
17 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc13 -o cc13.bundle
18 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc14 -o cc14.bundle
19 $C{COMPILE} -bundle -bundle_loader concurrentcat.exe -framework Foundation $DIR/concurrentcat_category.m -DTN=cc15 -o cc15.bundle
24 #include <objc/runtime.h>
25 #include <objc/objc-auto.h>
29 #include <Foundation/Foundation.h>
31 @interface TargetClass : NSObject
34 @interface TargetClass(LoadedMethods)
53 @implementation TargetClass
54 - (void) m0 { fail("shoulda been loaded!"); }
55 - (void) m1 { fail("shoulda been loaded!"); }
56 - (void) m2 { fail("shoulda been loaded!"); }
57 - (void) m3 { fail("shoulda been loaded!"); }
58 - (void) m4 { fail("shoulda been loaded!"); }
59 - (void) m5 { fail("shoulda been loaded!"); }
60 - (void) m6 { fail("shoulda been loaded!"); }
63 void *threadFun(void *aTargetClassName) {
64 const char *className = (const char *)aTargetClassName;
68 Class targetSubclass = objc_getClass(className);
69 testassert(targetSubclass);
71 id target = [targetSubclass new];
77 [target addObserver: target forKeyPath: @"m3" options: 0 context: NULL];
78 [target addObserver: target forKeyPath: @"m4" options: 0 context: NULL];
80 RELEASE_VALUE(target);
85 [target removeObserver: target forKeyPath: @"m4"];
86 [target addObserver: target forKeyPath: @"m5" options: 0 context: NULL];
101 [target removeObserver: target forKeyPath: @"m3"];
102 [target removeObserver: target forKeyPath: @"m5"];
114 for(i=1; i<16; i++) {
117 sprintf(dlName, "cc%d.bundle", i);
118 dylib = dlopen(dlName, RTLD_LAZY);
120 sprintf(className, "cc%d", i);
121 pthread_create(&t, NULL, threadFun, strdup(className));