Index: /trunk/ccl/examples/objc-runtime.lisp
===================================================================
--- /trunk/ccl/examples/objc-runtime.lisp	(revision 840)
+++ /trunk/ccl/examples/objc-runtime.lisp	(revision 841)
@@ -223,4 +223,9 @@
       (error "Class ~S isn't recognized." m))))
 
+(defun canonicalize-registered-class-or-metaclass (x)
+  (if (%objc-metaclass-p x)
+    (canonicalize-registered-metaclass x)
+    (canonicalize-registered-class x)))
+
 
 ;;; Open shared libs.
@@ -230,4 +235,12 @@
 
 
+(defun current-ns-thread ()
+  (with-cstrs ((class-name "NSThread")
+               (message-selector-name "currentThread"))
+    (let* ((nsthread-class (#_objc_lookUpClass class-name))
+           (message-selector (#_sel_getUid message-selector-name)))
+      (#_objc_msgSend nsthread-class message-selector)
+      nil)))
+  
 (defun create-void-nsthread ()
   ;; Create an NSThread which does nothing but exit.
@@ -268,4 +281,5 @@
        (open-shared-library "/System/Library/Frameworks/Cocoa.framework/Cocoa")
        (#_GetCurrentEventQueue)
+       (current-ns-thread)
        (create-void-nsthread))))
 
@@ -444,5 +458,6 @@
 		(%make-objc-ivars c)
 	      (%add-objc-class c ivars instance-size)
-	      (splay-tree-put class-map c i))))))))
+	      (splay-tree-put class-map c i)
+              (format t "~& addded ~s" (class-name c)))))))))
 
 (pushnew #'revive-objc-classes *lisp-system-pointer-functions*
