Another feature of this is that it can be run on the main UI (STA) thread as it uses _manualResetEvent.WaitOne(). If you used WaitHandle.WaitAll you'd have to run on the MTA thread, which may not be convenient. I hope you'll agree it's a nice lightweight simple solution to this problem.
Usage as follows:-
var batchExecutor = new BatchExecutor();
_actions.ForEach(action => batchExecutor.AddMethodToExecute(action.Initialise));
batchExecutor.ExecuteAndWaitUntilAllComplete();
Batch Executor class:-
public class BatchExecutor
{
private readonly List
private readonly ManualResetEvent _manualResetEvent;
private int _methodsLeftToExecute;
public BatchExecutor()
{
_actions = new List
_manualResetEvent = new ManualResetEvent(false);
}
public void AddMethodToExecute(Action action)
{
_actions.Add(action);
Interlocked.Increment(ref _methodsLeftToExecute);
}
public void ExecuteAndWaitUntilAllComplete()
{
_actions.ForEach(action => ThreadPool.QueueUserWorkItem(o =>
{
action();
if (Interlocked.Decrement(ref _methodsLeftToExecute) == 0)
_manualResetEvent.Set();
}));
_manualResetEvent.WaitOne();
}
}
First of all. Thanks very much for your useful post.
ReplyDeleteI just came across your blog and wanted to drop you a note telling you how impressed I was with the
information you have posted here.
Please let me introduce you some info related to this post and I hope that it is useful for community.
There is a good C# resource site, Have alook
http://CSharpTalk.com
Thanks again
Rahul
ISO files by having an internal drive that is definitely digital. It could possibly process rather nearly all CD / DVD / BD image files ISO that's together with and data. Power ISO Crack offers you an answer that's all-in-one. You'll be able to positively do every standard thing with your ISO files and disc image files.
ReplyDeleteIn addition, it really is an archiving software
Thanks for the great message! I really enjoyed reading
ReplyDeleteyou could be a good writer. Evil Alvzis notes blog and testament
will finally come back later. I want to support
keep writing well, have a nice weekend!
xmedia recode crack
tweakbit driver updater crack
vmware workstation pro crack
windows 10 product key crack
Mycleanpc is an optimization tool and a cleaning software that protects your computer from adware, cache, and other temporary files.
ReplyDeleteIt also includes a registry cleaner and a privacy protector that will wipe out all unwanted data items that have been collected over time within your browser.
miracle box crack
coreldraw graphics suite x3 crack
avast driver updater crack
adobe photoshop elements crack
Your website has a great design. Colors and themes that pop!
ReplyDeleteIs this a work of your own? Please respond again since I want to construct one of my own.
and I'd want to know where you've came from on this site
The item's name is derived from this location.
Sincerely,
avg pc tuneup crack
output arcade crack
imazing crack activation code
mocha pro crack
I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to saqibtech.net But thankfully, saqibtech.net
ReplyDeletepoweriso-crack
driver-talent-pro-crack
glasswire-elite-crack
free-youtube-to-mp3-converter-crack
teracopy-pro-crack
I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to saqibtech.net But thankfully, saqibtech.net
ReplyDeletepoweriso crack
driver talent pro crack
glasswire elite crack
free youtube to mp3 converter crack
teracopy pro crack
Your site has a great design. Colors and themes that appear!
ReplyDeleteIs this your job? Please answer again because I want to build it myself.
and I want to know where you are on this page
The item's name comes from this location.
Honestly,
pycharm crack
norton internet security crack
avocode crack
ashampoo music studio crack
Thanks for sharing such a great article with us. This surely helps me in my work. Thanks a lot.
ReplyDeleteDeath Stranding Crack
FIFA 22 Crack
unhackme pro crack
Valheim Crack
ReplyDeleteOh my goodness! Impressive article dude! Thanks, However I am having troubles with your RSS. I don’t understand the reason why I am unable to join it. Is there anybody having the same RSS issues? Anyone that knows the answer will you kindly respond? Thanx!!
dead age hi2u crack
voice recorder apk
protonvpn crack
google play store android crack
sid meiers civilization new frontier pass part crack
avast premium security crack
mindgenius business crack
You have a great site, but I wanted to know if you know.
ReplyDeleteAny community forum dedicated to these topics.
What was discussed in this article? I really want to be a part of it.
A society in which I can obtain information from others with knowledge and interest.
Let us know if you have any suggestions. I appreciate this!
omnisphere crack
omnisphere crack
omnisphere crack
omnisphere crack
omnisphere crack
omnisphere crack
omnisphere crack
Thank you for the information.
ReplyDeleteit has been quite beneficial to me.
I'm hoping for a few more postings from you.
artisteer crack
macromedia flash Crack
malwarebytes anti malware crack
kaspersky internet security crack
I saw your writing skills. Your writing skills are amazing. I also really like your ability to write.
ReplyDeleteYour writing skills have given me a lot of perspective on this subject. I think you're an old blogger.
connectify hotspot crack
tsr watermark image pro crack
zookaware pro crack
teamviewer meeting crack
windows 10 education crack
gridinsoft trojan killer crack
aiseesoft screen recorder crack
driver genius pro crack
Hi! Your Blog Writing is Very Wonderfull And Amazing. Thanks For Sharing...
ReplyDeleteimyfone umate pro crack
bluestacks app player crack
mame crack
brave browser crack
emeditor professional crack
Hi! Please know how much I appreciate your site and how much I look forward to the new content you provide.
ReplyDeleteFor which of your blog posts do I have to pay?
Interested parties are encouraged to share their knowledge of other online services that may be of interest to me.
It's really you.
sam broadcaster pro crack
cyberlink photodirector ultra crack
express vpn crack keygen
vcarve pro crack
ntlite crack
I am very impressed with your post because this post is very beneficial for me and provide a new knowledge to me.
ReplyDeleteThanks for sharing this post is an excellent article. Keep it up. I use the same blogging platform that you have and have.
it Is Very Informative Thanks For Sharing. I have also Paid This sharing. I am ImPressed For With your Post Because This post is very.
edius 8
telly erp crack
etimetracklite
poweriso crack
movavi video converter crack
A big thanks to you for sharing this with everyone you know who may be interested in this subject matter.
ReplyDeleteMy website is also available for your reference.
We might be able to work together on a link trade deal.
adobe premiere elements crack
nordvpn crack
avg pc tuneup crack
wondershare dr fone crack
ReplyDeleteYou are so interesting! I don't think I've read anything like this before.
It's great to find someone with real ideas on this topic. Indeed ... thank you very much for starting.
This site is something needed on the internet, not real!
This is a great blog! Your site is loading too fast!
What type of web server do you use? Can you send me an affiliate link for your web host?
apeaksoft mobietrans crack
high logic fontcreator crack
coolmuster pdf creator pro crack
acdsee photo studio home crack
teamviewer crack
abelssoft bankingbrowser crack
kms 2038 digital online crack
amolto call recorder premium for skype crack
windows password recovery tool ultimate crack
adguard premium crack
Amazingly pertinent and helpful data. Wanted to encourage you to keep up the excellent work!
ReplyDeletedevice doctor full crack
wise care 365 pro crack
mixcraft crack
sketch 92 crack
ReplyDeleteit is the best website for all of us. it provides all types of software which we need. you can visit this website.
majorjeekm
liveprocrack
livecrackerm
sunnypc
Avast Secure Browser 110.0.20188.100 crack remains protected, isolated, and then convenient net browser which stops hackers after larceny their figures. Consuming it, user can simply mask all user kind connected to protect their isolated data benign; hunks spiteful websites then transfers, and practice encryption toward protected their statistics.
ReplyDeleteavast secure browser crack