kernel/sched.c - schedule()

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

 



In the schedule() function, there is this line:

if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) {

I wonder why the right part is needed.
PREEMPT_ACTIVE is defined to 0x4000000,
so, even if preempt_count() return 0,1,2,.. it will always be 0 when we do the 
logical AND with 0x4000000. So !0 become true, therefore the right side is 
always true. Maybe am I missing something?
TIA


--
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