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
Post a Comment