7 Replies
if you set a breakpoint the debugger will reveal this, but I suspect your
while
loop is spinning indefinitely waiting for the file to unlock
that is of course happening on the UI threadYeah the reason i figure, idk how to get around that
Because if the ui gets stuck i cant close the open file
you should prefer using
async
and Task
versus creating your own threads
how is this code being called? is it in an event?
$asyncFor an introduction to
async
and await
in C#, https://blog.stephencleary.com/2012/02/async-and-await.htmlAsync and Await
Most people have already heard about the new “async” and “await” functionality coming in Visual Studio 11. This is Yet Another Introductory Post.
there's a snippet in there that shows how it ties in with events, like button presses
Ik about async and await
im working on a complex project
which has ALOT of sub projects dependencies etc
events wrappers delegats threads are all over the code
there are alot of threads runing at the same time
so i cant just break code convention and go my own way
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.