Closed GoogleCodeExporter closed 9 years ago
Hm. It was a while I wrote that code so it actually looks a little bit hooky to
me
now (and I've not seen C# code in quite a while).
But, the intent of the semaphore was to make sure that the helper thread that
does
all the commands doesn't go in an infinite loop, but rather sits and sleeps
until the
main thread nudges it. It seems that that should work ok to allow the semaphore
to
have higher values since it seems to be the max depth of the queue the max
semaphore
value describes. I'll see if I can get the fix into the main line.
Original comment by jim.tila...@gmail.com
on 12 Jun 2008 at 6:08
I've been running with that change for a few months now and things work great
-- I
tried to submit the bug when I first found it, but submitting new issues was
offline
for a few days and I forgot about it.
The alternative would be to do something like the following (pseudo code
because I'm
at home and don't have the code handy):
while (threadShouldContinue)
{
m_semaphore.WaitOne();
while (!m_queue.Empty())
{
... Process p4 commands ...
}
}
Thanks for the quick response!
Original comment by josh.faust@gmail.com
on 12 Jun 2008 at 6:26
The code is now checked in and in the 1.0.3 release. Thanks for the catch!
Original comment by jim.tila...@gmail.com
on 29 Jun 2008 at 6:41
Original comment by jim.tila...@gmail.com
on 29 Jun 2008 at 6:42
Original issue reported on code.google.com by
josh.faust@gmail.com
on 11 Jun 2008 at 10:45