Skip to content

Comment on In the C++ bag of tricks: scoped locksparent

Comments

if you can rely on gcc, cleanup attribute is probably the best you can do. The solution in original post doesn't cope with "break", "continue", "return" (and of course, "goto", but I don't remember if cleanup attribute handles that either).

Looks like their project already uses C++ though, so why don't they just use C++ for this is beyond me.

Agreed.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.