thready
asked on
simple java question
An example in "android developer's cookbook", p. 57, shows how to stop a thread with the following:
If(myThread != null) {
Thread dummy = myThread;
MyThread = null;
dummy.interrupt();
}
My question is, why not just do this?
If(myThread != null) {
myThread.interrupt();
myThread = null;
}
Are these not equivalent?
Thanks,
Mike
If(myThread != null) {
Thread dummy = myThread;
MyThread = null;
dummy.interrupt();
}
My question is, why not just do this?
If(myThread != null) {
myThread.interrupt();
myThread = null;
}
Are these not equivalent?
Thanks,
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER