[openib-general] Re: [PATCH] cm refcount race fix

Roland Dreier rdreier at cisco.com
Mon May 8 09:41:36 PDT 2006


Good idea.  I think with

static inline int get_obj_refcount(struct foo *obj)
{
        int c;

        spin_lock_irq(&obj->lock);
        c = obj->refcount;
        spin_unlock_irq(&obj->lock);

        return c;
}

then

	wait_event(&obj->wait, !get_obj_refcount(&obj));

looks like a pretty clean solution.

 - R.



More information about the general mailing list