Skip to content

Commit

Permalink
feat: small optimization to the sync state queue
Browse files Browse the repository at this point in the history
  • Loading branch information
ngenovese11 committed May 23, 2024
1 parent 1875d37 commit bd9851f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
18 changes: 14 additions & 4 deletions src/CodecSyncState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private set
var handler = InitialSyncCompleted;
if (handler != null)
handler(this, new EventArgs());

Schedule();
}
_initialSyncComplete = value;
}
Expand Down Expand Up @@ -233,12 +235,19 @@ private object RunSyncState(object o)
{
Debug.Console(1, this, "Error processing sys action:{0}", ex);
}

continue;
}

if (!_initialSyncComplete)
{
_waitHandle.Wait();
continue;
}


Action cmd;
if (_commandActions.TryToDequeue(out cmd) && InitialSyncComplete)
if (_commandActions.TryToDequeue(out cmd))
{
try
{
Expand All @@ -248,10 +257,11 @@ private object RunSyncState(object o)
{
Debug.Console(1, this, "Error processing usr action:{0}", ex);
}
continue;
}

_waitHandle.Wait();
else
{
_waitHandle.Wait();
}
}

return null;
Expand Down
1 change: 0 additions & 1 deletion src/epi-videoCodec-ciscoExtended.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
<Compile Include="DoNotDisturbHandler.cs" />
<Compile Include="MessageProcessor.cs" />
<Compile Include="UIExtensionsHandler.cs" />
<Compile Include="V2\CallStatusJoinMap.cs" />
<Compile Include="V2\CiscoAudio.cs" />
<Compile Include="V2\CiscoCallStatus.cs" />
<Compile Include="V2\CiscoCameras.cs" />
Expand Down

0 comments on commit bd9851f

Please sign in to comment.