[MediaContent] Fixed logic errors of async methods which caused blocking problems. 90/155490/2
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 13 Oct 2017 08:40:08 +0000 (17:40 +0900)
committerhj kim <backto.kim@samsung.com>
Sun, 15 Oct 2017 23:30:26 +0000 (23:30 +0000)
The cause is wrong type has been used when creating the TaskCompletionSource.

Change-Id: I6aa63eb6105c466bb4914ffaccf7c94fac8c23a6
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabase.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs

index b373d7f..004b3ed 100644 (file)
@@ -353,7 +353,7 @@ namespace Tizen.Content.MediaContent
 
         private async Task ScanFolderAsyncCore(string folderPath, bool recursive, CancellationToken cancellationToken)
         {
-            var tcs = new TaskCompletionSource<bool>(TaskContinuationOptions.RunContinuationsAsynchronously);
+            var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
 
             using (var cbKeeper = ObjectKeeper.Get(GetScanCompletedCallback(tcs, cancellationToken)))
             using (RegisterCancellationAction(tcs, folderPath, cancellationToken))
index 7850a28..75dd19f 100644 (file)
@@ -600,7 +600,7 @@ namespace Tizen.Content.MediaContent
             ValidatePaths(paths);
 
             var pathArray = paths.ToArray();
-            var tcs = new TaskCompletionSource<bool>(TaskContinuationOptions.RunContinuationsAsynchronously);
+            var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
 
             Interop.MediaInfo.InsertCompletedCallback callback = (error, _) =>
             {