This is an awful lot of internal fiddling around RefCountedCond and ChangeStatus; did you try coding any of it in those structs? (Maybe this is the simplest way, it's just approaching a barrier so I'm curious.)