“+[SomeClass initialize] may have been in progress in another thread when fork() was called”

python multiprocessing程序运行时,报错:

objc[2483]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.
objc[2483]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.

解决方法:添加环境变量:

OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

附图:

“+[SomeClass initialize] may have been in progress in another thread when fork() was called”_第1张图片


参考:

  • http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html

你可能感兴趣的:(答疑解惑)