Local variable passed to thread. May it get reclaimed by GC before thread completion??? How to avoid it???
Hello,
my questiong is, I believe, very simple.
I have a method and inside it I'm passing a local variable (of a reference type) to a newly created thread (created inside the method itself). Since the method may end while the thread may not have yet completed its work, I was wondering if anything must be done to avoid the garbage collector reclaiming the variable before the thread has completed.
Thx.
Bob Rock