get rid of StatusFlag, use std::atomic instead