rabolfazl
rabolfazl

Reputation: 552

Using third-party code that contains ReentrantReadWriteLock in coroutines

I'm using a third-party library that uses ReentrantReadWriteLock internally for synchronization. Of course, the library has no suspending function. For my project I'm using coroutines. Is it safe to use the library with coroutines suspending functions?

Upvotes: 0

Views: 256

Answers (1)

Dominic Fischer
Dominic Fischer

Reputation: 1849

This is safe just make sure to wrap the code in runInterruptible(Dispatchers.IO) { }.

Upvotes: 0

Related Questions