ktor-samples
ktor-samples copied to clipboard
Eliminate potential conflict
number
is in a critical section as modified by multiple threads - there is a possibility that two threads will try to modify it at the same time and so the result is uncertain. It either needs to be synchronized with Mutex
, channel, or we need to use AtomicInteger
.