c# - Lock on Dispatcher -


lock {   dispatcher.begininvoke(dispatcherpriority.send, (sendorpostcallback)delegate(object o)  {    dosomething();  } } 

does lock remains acquired until dispatcher completes execution or released after sending dosomething(); execution dispatcher?

  • lock remains acquired until code under lock {} section completes execution.
  • in case means: until dispatcher.begininvoke completes execution.
  • and dispatcher.begininvoke executes asynchronously, means lock gets released "immediately" - dosomething() might start in moment when lock has been released.

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -