runOnClient
This commit is contained in:
parent
6910ee7d33
commit
0d5629ef07
@ -142,6 +142,14 @@ fun <V> runIfClient(value: V, lambda: () -> V): V {
|
||||
return value
|
||||
}
|
||||
|
||||
fun <V> runOnClient(value: V, lambda: () -> V): V {
|
||||
if (isClientThread()) {
|
||||
return lambda.invoke()
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
fun isServerThread(): Boolean {
|
||||
return Thread.currentThread() === _serverThread
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user