I *think* the underlying problem is that ConnectionSurfaceMap::with_stream_do() releases the mutex before invoking exec() - which means that another thread can call erase() without blocking and delete the buffer stream.
I *think* the underlying problem is that ConnectionSurfa ceMap:: with_stream_ do() releases the mutex before invoking exec() - which means that another thread can call erase() without blocking and delete the buffer stream.