move this out of its current synchronized block? As you mentioned before I don't think you need to sync on framewriter.

(and if you don't move it, you are holding framewriter's lock while you await writability, which is overlocking)