mac多线程报错 +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. 解决方案 - Alex的博客

Alex的博客

本博客的文章均为原创,是本人从事行业多年来所遇见一些小问题的解决心得,希望可以帮助到大家!



mac多线程报错 +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. 解决方案

今天写一个python多线程程序发现只要队列里面一写入数据 后面的子进程中打开网站就会报错

+[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called.

网上找的解决方案: 原因是mac更新了以后不支持动态ofrk()了好像


解决方案:

在环境变量中添加OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES


sudo vi ~/.bash_profile

末尾添加


export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES


保存重启已经就不报错了


参考:

https://www.tuicool.com/articles/BzIZbmv

浏览809  评论0  Alex于 2018-1-30 15:08
MAC
发言