3 $C{COMPILE} $DIR/concurrentcat.m -o concurrentcat.out -framework Foundation
5 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc1 -o cc1.dylib
6 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc2 -o cc2.dylib
7 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc3 -o cc3.dylib
8 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc4 -o cc4.dylib
9 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc5 -o cc5.dylib
10 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc6 -o cc6.dylib
11 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc7 -o cc7.dylib
12 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc8 -o cc8.dylib
13 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc9 -o cc9.dylib
14 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc10 -o cc10.dylib
15 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc11 -o cc11.dylib
16 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc12 -o cc12.dylib
17 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc13 -o cc13.dylib
18 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc14 -o cc14.dylib
19 $C{COMPILE} -undefined dynamic_lookup -dynamiclib $DIR/concurrentcat_category.m -DTN=cc15 -o cc15.dylib
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;
66 objc_registerThreadWithCollector();
70 Class targetSubclass = objc_getClass(className);
71 testassert(targetSubclass);
73 id target = [targetSubclass new];
79 [target addObserver: target forKeyPath: @"m3" options: 0 context: NULL];
80 [target addObserver: target forKeyPath: @"m4" options: 0 context: NULL];
82 RELEASE_VALUE(target);
87 [target removeObserver: target forKeyPath: @"m4"];
88 [target addObserver: target forKeyPath: @"m5" options: 0 context: NULL];
103 [target removeObserver: target forKeyPath: @"m3"];
104 [target removeObserver: target forKeyPath: @"m5"];
116 for(i=1; i<16; i++) {
119 sprintf(dlName, "cc%d.dylib", i);
120 dylib = dlopen(dlName, RTLD_LAZY);
122 sprintf(className, "cc%d", i);
123 pthread_create(&t, NULL, threadFun, strdup(className));