Safer blocking calls
This commit is contained in:
parent
cf00451465
commit
b3f1ecf368
|
@ -21,6 +21,7 @@ import dorkbox.network.Server
|
||||||
import dorkbox.network.connection.Connection
|
import dorkbox.network.connection.Connection
|
||||||
import dorkbox.network.serialization.Serialization
|
import dorkbox.network.serialization.Serialization
|
||||||
import dorkboxTest.network.BaseTest
|
import dorkboxTest.network.BaseTest
|
||||||
|
import kotlinx.coroutines.runBlocking
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import java.util.concurrent.atomic.AtomicInteger
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
|
|
||||||
|
@ -85,6 +86,8 @@ class RmiDelayedInvocationTest : BaseTest() {
|
||||||
|
|
||||||
// sometimes, this method is never called right away.
|
// sometimes, this method is never called right away.
|
||||||
remoteObject.setOther(i.toFloat())
|
remoteObject.setOther(i.toFloat())
|
||||||
|
|
||||||
|
runBlocking {
|
||||||
synchronized(iterateLock) {
|
synchronized(iterateLock) {
|
||||||
try {
|
try {
|
||||||
(iterateLock as Object).wait(1)
|
(iterateLock as Object).wait(1)
|
||||||
|
@ -95,6 +98,7 @@ class RmiDelayedInvocationTest : BaseTest() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logger.error("Done with delay invocation test")
|
logger.error("Done with delay invocation test")
|
||||||
|
|
||||||
stopEndPoints()
|
stopEndPoints()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user