Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-tm-dev] Mutex waitForLock() updates the progress monitor

Hi Martin,

Well I was missing something, namely learning the existence of SubProgressMonitor/SubMonitor, and reading this: http://www.eclipse.org/articles/Article-Progress-Monitors/article.html :)

Now if I understand this article correctly:

- As a client I shouldn't be passing my main IProgressMonitor to a method without expecting it to do any work or without knowing exactly how much work it is going to do. As a matter of fact, I should expect that a method receiving a progress monitor will do ALL the work on it. So unless I know I'm not doing any work myself, then I must pass a SubMonitor created from my progress monitor, or pass null (but then I forfeit cancellation support).

- As a receiver of a progress monitor the method waitForLock() should consider being given the contract to do all the work, and therefore call beginTask(), optionally some worked(), and finally done().

- As a client, because I'm using SubMonitor as opposed to SubProgressMonitor, I am now protected from a called method that fails to call done().

I hope I got that right...

Thanks,
Patrick


Back to the top