QTripleBuffer rewritten