在worker线程中不支持直接使用getContext接口获取主线程的context信息。主线程和worker线程的上下文不一致。需要访问系统服务和资源时,需要将主线程的context发送消息的方式传输到worker线程中。参考链接:https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/multi-thread-concurrency-overview.md\#native%E7%BB%91%E5%AE%9A%E5%AF%B9%E8%B1%A1
在worker线程中不支持直接使用getContext接口获取主线程的context信息。
主线程和worker线程的上下文不一致。需要访问系统服务和资源时,需要将主线程的context发送消息的方式传输到worker线程中。
参考链接:
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/arkts-utils/multi-thread-concurrency-overview.md\#native%E7%BB%91%E5%AE%9A%E5%AF%B9%E8%B1%A1