Add a comment

This commit is contained in:
tzugen 2021-10-23 16:13:05 +02:00
parent 2847a51674
commit ece53f7687
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 3 additions and 0 deletions

View File

@ -752,6 +752,9 @@ class MediaPlayerService : Service() {
@JvmStatic
fun getInstance(): MediaPlayerService? {
val context = UApp.applicationContext()
// Try for twenty times to retrieve a running service,
// sleep 100 millis between each try,
// and run the block that creates a service only synchronized.
for (i in 0..19) {
if (instance != null) return instance
synchronized(instanceLock) {