SuccessChanges

Summary

  1. Potential interrupt of not owned Thread (details)
  2. Improved test: directly use Jobs.schedule (details)
  3. Potential interrupt of not owned Thread (2) (details)
Commit 61eddb5d74469af17eed24a2f9b24617b1f1b2ed by Ivan Motsch
Potential interrupt of not owned Thread
JobFutureTask.run does not synchronize on the leased Thread in its try
finally section. A potential race condition can occur when another
Thread calls JobFutureTask.interrupt. The local variable used to cache
the volatile value may still be set after run() sets the Thread member
field to null. The Thread may now be running another task and is then
accidentially interrupted.
The fix uses safe AtomicReference<Thread> with a synchronize-on-use
contract.
243526
Change-Id: I9eeec1445147dd53b620581af0d1648a48c7d67e Signed-off-by: Ivan
Motsch <ivan.motsch@bsiag.com> Reviewed-on:
https://git.eclipse.org/r/151448 Reviewed-by: Matthias Villiger
<mvi@bsi-software.com> Tested-by: CI Bot
The file was modifiedorg.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/job/internal/JobFutureTask.java
The file was addedorg.eclipse.scout.rt.platform.test/src/test/java/org/eclipse/scout/rt/platform/job/JobFutureTaskTest.java
Commit 18fcf120c49f6d0910d8c42484bc1be687d93fbe by Ivan Motsch
Improved test: directly use Jobs.schedule
This test variant has a better chance to produce the expected failure in
case the cancellation cancels the wrong thread.
Change-Id: Ic69a545450705387fa3024db01dddc98e12517ca Signed-off-by: Ivan
Motsch <ivan.motsch@bsiag.com>
The file was modifiedorg.eclipse.scout.rt.platform.test/src/test/java/org/eclipse/scout/rt/platform/job/JobFutureTaskTest.java
Commit bfa89b84261c552878f71fd242062dbb08f85c86 by Ivan Motsch
Potential interrupt of not owned Thread (2)
minor improvements:
- make lock object final
- make volatile assignment final
- make private method hot-fixable using protected modifier
- unit test: cancel after wait
Change-Id: I5909c6abcc36c24c6fa0e630b7b51a1fafa7a91e Signed-off-by: Ivan
Motsch <ivan.motsch@bsiag.com>
The file was modifiedorg.eclipse.scout.rt.platform.test/src/test/java/org/eclipse/scout/rt/platform/job/JobFutureTaskTest.java
The file was modifiedorg.eclipse.scout.rt.platform/src/main/java/org/eclipse/scout/rt/platform/job/internal/JobFutureTask.java