File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
SoraUnitySdkExamples/Assets/SoraUnitySdk Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -582,10 +582,7 @@ public void Dispose()
582582 p = IntPtr . Zero ;
583583 }
584584
585- lock ( rpcResponseJsonQueue )
586- {
587- rpcResponseJsonQueue . Clear ( ) ;
588- }
585+ rpcResponseJsonQueue . Clear ( ) ;
589586 pendingRpcRequests . Clear ( ) ;
590587
591588 foreach ( var adapter in audioTrackSinks . Values )
@@ -1262,10 +1259,7 @@ public Action<string, byte[]>? OnMessage
12621259 static private void RpcCallback ( string json , IntPtr userdata )
12631260 {
12641261 var sora = GCHandle . FromIntPtr ( userdata ) . Target as Sora ;
1265- lock ( sora ! . rpcResponseJsonQueue )
1266- {
1267- sora . rpcResponseJsonQueue . Enqueue ( json ) ;
1268- }
1262+ sora ! . rpcResponseJsonQueue . Enqueue ( json ) ;
12691263 }
12701264
12711265 // RPC リクエストタイムアウト時間算出のための基準時間を生成
@@ -1286,14 +1280,11 @@ void HandleRpcInternal()
12861280 while ( true )
12871281 {
12881282 string responseJson ;
1289- lock ( rpcResponseJsonQueue )
1283+ if ( rpcResponseJsonQueue . Count == 0 )
12901284 {
1291- if ( rpcResponseJsonQueue . Count == 0 )
1292- {
1293- break ;
1294- }
1295- responseJson = rpcResponseJsonQueue . Dequeue ( ) ;
1285+ break ;
12961286 }
1287+ responseJson = rpcResponseJsonQueue . Dequeue ( ) ;
12971288
12981289 // レスポンスデータの JSON 文字列をパースして、リクエスト ID のみを抜き出します。
12991290 // ID が取得できない場合や JSON 文字列が不正な場合はレスポンス待ちと紐付けできないため捨てます。
You can’t perform that action at this time.
0 commit comments