synchronized
Executes the given block of code within a synchronized block, using the specified SynchronizedObject as the synchronization object. This function simplifies the process of creating synchronized blocks safely.
Usage:
val syncObject = SynchronizedObject()
synchronized(syncObject) {
// Critical section of code
}
Content copied to clipboard
Executes the given block of code within a synchronized block, using the specified SynchronizedObject as the synchronization object. This function simplifies the process of creating synchronized blocks safely.
Usage:
val syncObject = SynchronizedObject()
synchronized(syncObject) {
// Critical section of code
}
Content copied to clipboard