This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
The key here is what happens in upload(). Setting the finished flag does not stop upload() from executing, it just prevents it from running again. If you want to make sure upload() stops before it completes there needs to be some way to interrupt the execution of that code. Since you don't show that code it is hard to say how you should do that.