I'm sure this question has been asked before on here, but after searching around google and here I couldn't find anything.
Here's my situation, I've got multiple threads writing to a file, and a main thread that creates a print writer and handles creating the file and closing the print writer inside a finally block in a try/catch loop. When I run the application inside eclipse, I would press the stop/terminate button, and the file doesn't have anything written to it. I want to ensure that I'm doing everything correct here, or if there's a better way to handle closing a print writer whenever execution is terminated. Heck, if there's a better way to handle multiple threads writing to a file, I'm welcome to that advice (I'm pretty terrible at multithreaded programming right now).