Re: [AD] clipping without locking? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I was just wondering, the mouse drawing from the timer works like this
> in principle:
>
> acquire_bitmap
> screen->clip = TRUE
> /* switch occurs here */
> draw
> restore screen->clip
> release_bitmap
>
> But now, what if the timer thread is switched out just before draw, as
> indicated above, and the main thread modifies the clipping of the
> screen. Wouldn't this cause a crash? Am I overlooking something?
You're not, this stuff is well-known to be racy. Search the archives for
various messages (mostly by me I think) about the problem.
--
Eric Botcazou