Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用在内部使用 ReentrantReadWriteLock 进行同步的第三方库。当然,库没有挂起功能。对于我的项目,我正在使用协程。使用带有协程挂起功能的库是否安全?
这是安全的,只需确保将代码包装在runInterruptible(Dispatchers.IO) { }.
runInterruptible(Dispatchers.IO) { }