java - synchronizedList.toCollections 是否需要同步?
问题描述
val listA = Collections.synchronizedList<Int>(mutableListOf())
// ..... some code goes here...
listB = listA.toCollection(mutableListOf())) // Copy the results
// Runs in a different thread
fun A(listA) {
listA.add(10)
}
listA.toCollection 是否需要同步?
解决方案
推荐阅读
- docker - Docker - 从私有网络访问主机
- python - Python 进程 TypeError: no default __reduce__ due to non-trivial __cinit__
- apache-spark - 分配最大 spark.driver.memory
- javascript - Angular12 中的兄弟组件如何监听彼此的事件?
- python - 有没有办法用 Selenium 提取 CSS 选择器?
- java - 将应用程序构建到 jar 后资源未加载
- python - 在括号中切换多行或单行 Vim
- regex - 正则表达式匹配第二行中一组数字中的第二个数字
- composite - Geode Native Client 复合键
- python - 向 JSON 文件添加多个参数