ObjFW  Check-in [ae80dcd8e0]

Overview
Comment:runtime: objc_unregisterClass: Get global lock
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ae80dcd8e05b4904610ba2ec17eb5b29ea54f58d0052076cff1c282ebe2733e6
User & Date: js on 2021-05-02 11:43:38
Other Links: manifest | tags
Context
2021-05-02
11:59
ofhttp: Fix typo check-in: 5a087b5409 user: js tags: trunk
11:43
runtime: objc_unregisterClass: Get global lock check-in: ae80dcd8e0 user: js tags: trunk
11:34
runtime: Name things more consistently check-in: 2b75f9e6a0 user: js tags: trunk
Changes

Modified src/runtime/class.m from [a72b4d25e1] to [70c18ee4cd].

   926    926   }
   927    927   
   928    928   void
   929    929   objc_unregisterClass(Class class)
   930    930   {
   931    931   	static SEL unloadSel = NULL;
   932    932   
          933  +	objc_globalMutex_lock();
          934  +
   933    935   	if (unloadSel == NULL)
   934    936   		unloadSel = sel_registerName("unload");
   935    937   
   936    938   	while (class->subclassList != NULL && class->subclassList[0] != Nil)
   937    939   		objc_unregisterClass(class->subclassList[0]);
   938    940   
   939    941   	if (class->info & OBJC_CLASS_INFO_LOADED)
................................................................................
   942    944   	objc_hashtable_delete(classes, class->name);
   943    945   
   944    946   	if (strcmp(class_getName(class), "Protocol") != 0)
   945    947   		classesCount--;
   946    948   
   947    949   	unregisterClass(class);
   948    950   	unregisterClass(class->isa);
          951  +
          952  +	objc_globalMutex_unlock();
   949    953   }
   950    954   
   951    955   void
   952    956   objc_unregisterAllClasses(void)
   953    957   {
   954    958   	if (classes == NULL)
   955    959   		return;