Re: [AD] race condition in X11

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Monday 28 November 2005 15:02, Vincent Penecherc'h wrote:
> Anyway, looking at the code for scare_mouse, it doesn't check
> if the screen is locked, though there is a BMP_ID_LOCKED flag
> that could be checked.

I think it should be checked at a `deeper' level, but I'm not sure I have a 
clear picture of the problem.

Anyway, you should let X draw the cursor for you and not bother with Allegro's 
soft cursor :P

> Is there a reason for this, or would 
> it be alright if I added an assert there ?

Maybe. I'd have to think a bit about it to make up my mind though. ;)

> Also, another strange thing is that calling acquire twice is
> apparently OK (eg, no assert), the second call doesn't seem
> to do anything (from memory). 

That's the documented behavior.

> It doesn't track the number of 
> calls, though, so it will screw up the nesting.

This is a bug though.

> I think it 
> ought to assert there (and unacquire (IIRC) should assert the
> BITMAP is locked, if it doesn't already.

No. Nested locks are allowed, but only the last call to release_bitmap() 
should release it.

> Would it break
> the binary API to add a flags member to the BITMAP array ?
> (eg, bad malloc sizes, etc)

Yes, because it changes the size of the BITMAP struct.

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/