Multithreading [NSDocument\u doCleanupOldVersions]\u block\u invoke阻塞主线程

Multithreading [NSDocument\u doCleanupOldVersions]\u block\u invoke阻塞主线程,multithreading,cocoa,grand-central-dispatch,nsdocument,timemachine,Multithreading,Cocoa,Grand Central Dispatch,Nsdocument,Timemachine,我发现我的应用程序在主线程上等待了很长时间,而堆栈如下所示: semaphore_wait_trap () _dispatch_semaphore_wait_slow () GSSystemManagedStorageCopyAllGenerationsInfos () GSLibraryCopyAllGenerationsInfos () +[NSFileVersion(NSPrivate) _otherNonpurgeableVersionsOfItemAtURL:temporaryStor

我发现我的应用程序在主线程上等待了很长时间,而堆栈如下所示:

semaphore_wait_trap ()
_dispatch_semaphore_wait_slow ()
GSSystemManagedStorageCopyAllGenerationsInfos ()
GSLibraryCopyAllGenerationsInfos ()
+[NSFileVersion(NSPrivate) _otherNonpurgeableVersionsOfItemAtURL:temporaryStorageIdentifier:] ()
__35-[NSDocument _doCleanupOldVersions]_block_invoke ()
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
__CFRunLoopDoBlocks ()
__CFRunLoopRun ()
CFRunLoopRunSpecific ()
RunCurrentEventLoopInMode ()
ReceiveNextEventCommon ()
_BlockUntilNextEventMatchingListInModeWithFilter ()
_DPSNextEvent ()
-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
-[NSApplication run] ()
NSApplicationMain ()
其他线程似乎处于空闲状态

我能做些什么来避免这种方法在主线程上等待