We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f00386 commit 81c26caCopy full SHA for 81c26ca
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.kt
@@ -16,20 +16,10 @@
16
*/
17
public object UiThreadUtil {
18
19
- @Volatile private var mainHandlerInternal: Handler? = null
20
21
-
22
- private val mainHandler: Handler
23
- get() {
24
- if (mainHandlerInternal == null) {
25
- synchronized(this) {
26
27
- mainHandlerInternal = Handler(Looper.getMainLooper())
28
- }
29
30
31
- return mainHandlerInternal!!
32
+ private val mainHandler: Handler by lazy {
+ Handler(Looper.getMainLooper())
+ }
33
34
/**
35
* Returns the handler associated with the main (UI) thread.
0 commit comments