[Android] Headers: Add missing mutex

Geoffrey Métais git at videolan.org
Thu Feb 14 16:54:21 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 14 16:39:08 2019 +0100| [cf1372e116069d1c1e0e0ff853852be00affbb24] | committer: Geoffrey Métais

Headers: Add missing mutex

> https://code.videolan.org/videolan/vlc-android/commit/cf1372e116069d1c1e0e0ff853852be00affbb24
---

 vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
index 2f91ee158..1d6cf45f3 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
@@ -127,7 +127,7 @@ abstract class MLPagedModel<T : MediaLibraryItem>(context: Context) : SortableMo
         return ""
     }
 
-    fun getHeaderForPostion(position: Int) = runBlocking { headers.get(position) }
+    fun getHeaderForPostion(position: Int) = runBlocking { mutex.withLock { headers.get(position) } }
 
     inner class MLDataSource : PositionalDataSource<T>() {
 



More information about the Android mailing list