Re: Merging changes to volatile bitfield structs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>So maybe I need to not declare it as volatile, and use some sort of "memory barrier".  That's a term that I have heard used but don't really understand.  But borrowing database terminology, how about
>
>  BEGIN
>    reg.a = 0;
>    reg.b = 0;
>    reg.c = 0;
>  COMMIT
>
>Can anyone share their preferred approach to this sort of problem?

You can wrap it into a class that provides the necessary functions
like SetBit, ClearBit, ToggleBit, Begin, Commit, Reset etc.

If you have C instead of C++ you can do the same with global
functions and the bitfield as additional argument.

bye  Fabi



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux