How to create a Thread-safe ContentProvider?

后端 未结 1 1301
清酒与你
清酒与你 2020-12-28 08:19

Android documentation says

ContentProvider methods can be called from various ContentResolver objects in different processes and threads, they must

1条回答
  •  有刺的猬
    2020-12-28 09:13

    You could make every method synchronized, but make sure it is absolutely necessary before you do. In cases where the underlying data source is already thread-safe making the methods synchronized could be costly. See my blog post on this topic for more information.

    0 讨论(0)
提交回复
热议问题