我们有如下方法测试异步调用耗时严重,目前准备使用taskpool调用,但文档中提到需注意线程安全问题。
deviceCertificate.getDeviceToken
settings.getValue
inputMethod.getSetting().getAllInputMethods
safetyDetect.checkSysIntegrity
请提供一个方法能验证所用方法如使用taskpool是否会有线程安全问题。
文档描述如下:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/multi-thread-safety-V5
safetyDetect.checkSysIntegrity是完整性检测处理处理逻辑是幂等性,多线程调用时线程安全的
deviceCertificate.getDeviceToken应用设备状态检测接口是线程安全
settings接口依赖context,放在taskPool会出现概率获取值失败的情况
inputMethod.getSetting().getAllInputMethods是线程安全