Re: why is atomic_t a struct

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

 




> I am wondering why can't we just have 
> typedef volatile int counter atomic_t;


1) it works around some gcc bugs in old gcc's
2) it provides type safety; it prevents accidental mixing of atomic_t
with other types, which would be code bugs.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux