replaced busy waiting of WriterThread with a semaphore (fixes full cpu
usage in idle)