rewritten syncronization protocol without QWaitCondition - simpler and actually working