On Mon, Mar 1, 2010 at 08:30, Adriaan de Groot <groot at kde.org> wrote:
> On Monday 01 March 2010 12:09:24 am Pavel Heimlich wrote:
>> [23:57] <thiago_home> ? ? ? ? ? ? ? ? val &= ~quintptr(1u);
>> [23:57] <thiago_home> ? ? ? ? ? ? ? ? mtx->unlock();
>> [23:57] <thiago_home> see? It's impossible to call mtx->unlock with a
>> pointer that ends in 9 or 1 [23:58] <thiago_home> (val and mtx are in a
>> union)
>
> That was sort of the point of the whole discusson: -xalias_level=compatible
> promises that you don't do that (access both val and mtx from the union
> interchangably).

That code is inherently broken, fixing it is trivial --  the only
thing TT has to do to fix it is to copy and paste code from the next
inline function three lines below --, and the fix does not introduce a
BIC.

So, that code should be fixed.

The wisdom of implementing a custom mutex in this particular way, when
portable mutex implementations are already available and do not
require this sillyness, is perhaps a subject matter for a different
thread.

--Stefan

-- 
Stefan Teleman
KDE e.V.
stefan.teleman at gmail.com

Reply via email to