1 /* Written by David Wetzel */
8 #include <objc/objc-api.h>
9 #include <objc/Object.h>
11 static const int debug = 0;
13 @interface MyClass : Object
17 -(void)setMyName:(const char *)n;
18 -(const char *)myName;
21 @implementation MyClass
22 -(void)setMyName:(const char *)n
27 if (strcmp(myName, n) != 0)
32 myName = objc_malloc(len);
42 printf("detached thread started!\n");
47 becomeMultiThreaded(void)
50 printf("becoming multithreaded!\n");
54 main(int argc, char *argv[])
58 objc_thread_callback cb;
61 [o setMyName:"thread"];
65 printf("Testing: %s\n",c);
67 cb = objc_set_thread_callback(becomeMultiThreaded);
69 printf("Old Callback: %p\n",cb);
71 rv = objc_thread_detach(@selector(start), o, nil);
73 printf("detach value: %p\n",rv);