C++ thread safe bitvector implementation