C (252/301)

From:Olaf Barthel
Date:13 Aug 99 at 08:19:14
Subject:RE: RMBTRAP

From: "Olaf Barthel" <olsen-amigac@sourcery.han.de>

On Aug 11 Lloyd (Lloyd Rosen) wrote:

> From: "Lloyd Rosen" <seasons@softhome.net>
>
> >From: "Olaf Barthel" <olsen-amigac@sourcery.han.de>
>
> >> You could change the Flags-field in the Window-structure when you
> >> needed to, but I'm not sure how well that's supported... And it's
> >> not good programming-style :P
>
> > It's the only way to do it, I'm afraid. Heed the documentation, though:
> >you must make the bit change an atomic operation so no Task switch can
> >occur while you are still making the change.
>
> How do I do an atomic operation (forbid/permit ?)

That will certainly do the trick. But most compilers automatically
perform an atomic operation when challenged with an instruction like
"window->Flags &= ~WFLG_RMBTRAP". However, the only way to know for sure
is to look at the disassembly, which can be a bit trying.



Home: Olaf Barthel, Brabeckstrasse 35, D-30559 Hannover
Net: olsen@sourcery.han.de (Home), olsen@logicalline.com (Work)