[Mesa-dev] [PATCH 2/3] mesa: Use a recursive mutex for the texture lock.

Dave Airlie airlied at gmail.com
Tue Aug 19 07:03:12 PDT 2014


> This avoids problems with things like meta operations calling functions
> that want to take the lock while the lock is already held.  Basically,
> the point is to guard against API reentrancy across threads...not to
> guard against ourselves.

I hate this on purely the grounds that I feel someone should always object
to recursive mutexes. They are always due to a bad layering violation at some
level. I won't cry if this goes in, but I'll guarantee someone will
regret this at
some point in their future.

Ideally we'd split the APIs so the GL entrypoints take the locks, but
meta uses pre-locked entrypoints, or everyone would just use gallium
and drop meta :-P

I'll also just leave this here.
http://www.zaval.org/resources/library/butenhof1.html

Dave.


More information about the mesa-dev mailing list