Re: [AD] [Unix] Using pthreads

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


George Foot <gfoot@xxxxxxxxxx> writes:

>     * When threading is not available, the display locking
>       system resides entirely within xwin.c now -- SIGALRM
>       interrupts will still fire, but xwin.c will ignore them
>       rather than relying on the SIGALRM handler to do this.  It
>       makes more sense this way because of how the threaded
>       version works.  So, xwin.c doesn't call DISABLE/ENABLE any
>       more -- it has its own macros, LOCK and UNLOCK, which
>       either use Xlib to lock the X display connection or, when
>       not using threads, perform a simple semaphore around the
>       _xwin_handle_events code.  This isn't really new, it's
>       just moved from the SIGALRM handler to the X code.

Just a little comment, I have not looked into your code, so maybe this
comment is wrong.

There is one more type of "threading", when critical signal hooked by
Allegro is caught (e.g. SIGINT).  Will this new locking work in this
case, or it may hang in deadlock (when allegro_exit shuts down gfx
driver), or call nested Xlib function?

Sorry if this is irrelevant.

-- 
Michael Bukin



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