Can't you just check for eventQueue.isEmpty? This can get rid of the `drained` variable. Also, if you synchronize on an existing variable (e.g. eventQueue) then you don't even need `drainedLock`.