Adding DECLSPEC_ALIGN(4) to structs for atomic DWORD access

David Laight david at l8s.co.uk
Mon Jan 21 15:55:00 CST 2013


On Mon, Jan 21, 2013 at 06:52:23PM +0100, Joerg-Cyril.Hoehle at t-systems.com wrote:
> Hi,
> 
> there are some places in Wine where I believe atomic access to 32bit entities
> is expected by the programmer, yet I see little or no measures to ensure this.
> 
> DWORD-Alignment is essential when several threads can access
> the same DWORD variable outside of a mutex (or within the implementation of the mutex).
> 
> DECLSPEC_ALIGN(4) is the declaration that could be used to enforce
> it within a struct, assuming the struct itself is somehow aligned.

32bit items will be 32bit aligned unless the structure is 'packed'
(or similar).

	David

-- 
David Laight: david at l8s.co.uk



More information about the wine-devel mailing list