Differences From Artifact [0a53af1b21]:
- File src/runtime/class.m — part of check-in [0509d7a844] at 2019-01-03 19:13:03 on branch trunk — Update copyright (user: js, size: 19487) [annotate] [blame] [check-ins using]
To Artifact [241b0f4d77]:
- File
src/runtime/class.m
— part of check-in
[1ac944d7c1]
at
2019-01-17 21:59:53
on branch trunk
— class_registerAlias_np(): Acquire the global mutex
A plugin which calls it might be loaded while already being
multi-threaded. (user: js, size: 19581) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
51 52 53 54 55 56 57 | if (strcmp(cls->name, "Protocol") != 0) classes_cnt++; } bool class_registerAlias_np(Class cls, const char *name) { | > > | > > | > > > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | if (strcmp(cls->name, "Protocol") != 0) classes_cnt++; } bool class_registerAlias_np(Class cls, const char *name) { objc_global_mutex_lock(); if (classes == NULL) { objc_global_mutex_unlock(); return NO; } objc_hashtable_set(classes, name, (Class)((uintptr_t)cls | 1)); objc_global_mutex_unlock(); return YES; } static void register_selectors(struct objc_abi_class *cls) { |
︙ | ︙ |