Closed Darida closed 7 years ago
ooh, nice find! looking at this now, thank you for the feedback...
Hi @Darida ;
If you can please give me a small sample of it breaking then I can write an acceptance test to add this to the code and fix it.
I believe the workaround for this (for now) is to create all the progress bars using a single thread and pass the 'created' progress bars to your threads doing any processing as a parameter, rather than having each separate thread create their own progress bar.
I can't confirm this workaround will work for you without a bit of sample code. A small sample will also help me make sure the fix I'm about to commit will definitely work for you.
For an example on multiple threads accessing ProgressBar
checkout ProgressBarDemos.cs
If you want to play with the examples I've written, the solution is really easy to check-out and build.
git clone https://github.com/goblinfactory/konsole.git
After cloning the project, right click on Konsole.Sample
project and set as startup project, and press F5, ...you'll get a menu with demos (see below) , press 'l' for the parallel thread demo.
Thanks, Alan
@Darida No worries, I have a test that reproduces the problem; fix is on the way...
fix and test committed. will push a new package a bit later. Here's test proving fix works
I will close issue as soon as new package has been published to nuget.
The refresh method has lock but constructor doesn't. So when threads creating ProgressBar inside or the one bar is already start reporting in other thread, the output overrides each other.