Skip to content

Commit

Permalink
Fix lock
Browse files Browse the repository at this point in the history
  • Loading branch information
tznind committed Nov 10, 2024
1 parent 1bd5d8d commit ccd25cd
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,16 @@ public IEnumerable<Tuple<char, T>> ProcessInput (params Tuple<char, T> [] input)
return output;
}

public IEnumerable<Tuple<char, T>> Release ()
public Tuple<char, T>[] Release ()
{
// Lock in case Release is called from different Thread from parse
lock (lockState)
{
foreach (Tuple<char, T> h in HeldToEnumerable ())
{
yield return h;
}
Tuple<char, T> [] result = HeldToEnumerable ().ToArray ();

ResetState ();

return result;
}
}

Expand Down

0 comments on commit ccd25cd

Please sign in to comment.