Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OK sorry that was a mistake. It's not a race.

But it's still non-local. one has to manually account for what allocation will be done, and keep the reservation in sync across refactors. This isn't a race but still scares me.

Someone could write

    shared_v.lock().try_reserved();
    shared_v.lock().something();
which would be a race. That is not `try_reserved`'s fault, and a rather easy-to-spot example, but I wonder if there are variations on this which are easier to miss.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: