I would use kotlinx.coroutines.channels.Channel as thread safe buffer. In your case maybe it would make sense to additionally use extension functions as suggested by William Reed.
kotlinx.coroutines.channels.Channel