Re: [osgi-dev] Life-cycle race condition

2018-08-01 Thread David Leangen via osgi-dev
Hi Tim, Thanks, and this is good advice. The example you give is when the thread is in the same component that is being deactivated. In this case, as you show, it is quite trivial to track the activation state of the component in order to shut down the thread. In my case, the trouble I am

Re: [osgi-dev] Setting reference target in component

2018-08-01 Thread Alain Picard via osgi-dev
Thanks Tim. I had read that thread but didn't make the association. I think my case falls between some of the described solutions and part of your point in 2, a bit of redesign :) Alain On Tue, Jul 31, 2018 at 12:42 PM Tim Ward wrote: > This sounds like a variation on this question >

Re: [osgi-dev] Life-cycle race condition

2018-08-01 Thread Tim Ward via osgi-dev
Hi David, In addition to interrupting the worker thread (which is a good idea). There are a couple of useful things that you can do using the support from java.util.concurrent. For example, setting a closed state: @Component public class MyClass { private final AtomicBoolean closed = new