How do make a .NET 4 thread wait for asynchronous requests to finish?
This is a fairly clean solution if you truly want to force these "tasks" to synchronize and block at this point. This is the main rationale behindI'm currently wrapping the asynchronous calls within a List of Task objects to use Tasks.WaitAll()
Task.WaitAll(), and is nice since it (optionally) allows you to cancel the blocking operation after a timeout, if you so choose.
Comments