From: coderhyme Date: Tue, 26 Sep 2017 22:31:44 +0000 (+0900) Subject: [Multimedia] Fixed a deadlock issue of Player.SetPlayPositionAsync. X-Git-Tag: preview1-00270^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1943ff7c94a3352e7890dcaf24634b580f61bdf2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Multimedia] Fixed a deadlock issue of Player.SetPlayPositionAsync. It occurs when the continuation of task is syncrhonous, which is not always. The callback in native holds a mutex, if user code tries to call SetPlayPositionAsync right after awaiting SetPlayPositionAsync. It could be blocked, the mutex is still locked. Change-Id: Ia968ab8d6e01401d3e5ee6551ebf8ae62ac99ea1 Signed-off-by: coderhyme --- diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs index 7dd4035..680716b 100644 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs @@ -523,7 +523,7 @@ namespace Tizen.Multimedia { ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - var taskCompletionSource = new TaskCompletionSource(); + var taskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); bool immediateResult = _source is MediaStreamSource;