Neil Hodgson wrote:

It is fixed; I decided to upload todays revisions under the same name as
above.
  OK. There are some threading worries. jobQueue.CurrentJob() returns
a pointer to a single job object which could potentially be deleted
while the pointer is being used even though currently this may be
safe. Since nothing is written into this pointer, you could make the
pointers const and also hand out a copy to ensure it can be used
without worrying about deletion.

I think I'll revise things again :-)

I'll remove 'CurrentJob()' and add 'CurrentJobFlags()' and 'CurrentJobBufferPath()' The two would be initialized within the CanExecute() code, returning copies of the respective values.
I'll play with it while I'm waiting for New Years to arrive...

  JobQueue::CurrentJobDirectory has a small vulnerability since it
doesn't lock and copying a FilePath involves allocations.
I was about to say you were worrying to much, because the internal variable is only assigned within GetNextJob(), but I recalled that it is initialized within JobQueue::Clear(), so I agree that the variable should be locked. Additionally, since GetNextJob() is only called from within CanExecute(), I've made it a private method.

April
Happy New Years!

--
Get a new car for your spouse. It'll be a great trade!

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to