Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -115,12 +115,10 @@ static struct objc_abi_module module = { 8, sizeof(module), NULL, (struct objc_abi_symtab*)&symtab }; -extern void __objc_exec_class(struct objc_abi_module*); - OF_CONSTRUCTOR() { __objc_exec_class(&module); } /* End of ObjC module */ Index: src/runtime/init.m ================================================================== --- src/runtime/init.m +++ src/runtime/init.m @@ -18,12 +18,14 @@ #import "runtime.h" #import "runtime-private.h" void -__objc_exec_class(struct objc_abi_module *module) +__objc_exec_class(void *module_) { + struct objc_abi_module *module = module_; + objc_global_mutex_lock(); objc_register_all_selectors(module->symtab); objc_register_all_classes(module->symtab); objc_register_all_categories(module->symtab); Index: src/runtime/runtime-private.h ================================================================== --- src/runtime/runtime-private.h +++ src/runtime/runtime-private.h @@ -154,11 +154,10 @@ extern void objc_dtable_set(struct objc_dtable*, uint32_t, IMP); extern void objc_dtable_free(struct objc_dtable*); extern void objc_dtable_cleanup(void); extern void objc_init_static_instances(struct objc_abi_symtab*); extern void objc_forget_pending_static_instances(void); -extern void __objc_exec_class(struct objc_abi_module*); #ifdef OF_HAVE_THREADS extern void objc_global_mutex_lock(void); extern void objc_global_mutex_unlock(void); extern void objc_global_mutex_free(void); #else Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -240,11 +240,11 @@ * * These declarations are also required to prevent Clang's implicit * declarations which include __declspec(dllimport) on Windows. */ struct objc_abi_module; -extern void __objc_exec_class(struct objc_abi_module*); +extern void __objc_exec_class(void*); extern IMP objc_msg_lookup(id, SEL); extern IMP objc_msg_lookup_stret(id, SEL); extern IMP objc_msg_lookup_super(struct objc_super*, SEL); extern IMP objc_msg_lookup_super_stret(struct objc_super*, SEL); extern void objc_exception_throw(id);