LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   in_atomic (https://www.linuxquestions.org/questions/programming-9/in_atomic-266619/)

zdscmnbc 12-15-2004 07:10 AM

in_atomic
 
In kernel 2.6.8 file -- include/linux/hardirq:
Suppose kernel with SMP.

#define in_atomic ((preempt_count()&~PREEMPT_ACTIVE) != kernel_locked())

Qeustion1:
Why can this definition represent the atomic operation?
In my opinion,in_atomic is defined like this:
#define in_atomic ((preempt_count() &~PREEMPT_ACTIVE) ||kernel_locked()

Question2:
What's meaning of task_struct::lock_depth?

Qeustion3:
Additionally,can current task release CPU when lock_depth>=0?

acid_kewpie 12-15-2004 07:43 AM

these are questions about programming the linux kernel, and have no relation to Local Linux user meetings or other social events. please pick a more suitable forum to post in next time. thanks

zdscmnbc 12-15-2004 07:54 AM

I'm wrong....
 
Thank you for reminding me.
I just successully register in LUG,and post an unrelated quetion.Please delete it.
Sorry.....

XavierP 12-15-2004 10:29 AM

This thread is more appropriate in Programming and has now been moved to that forum.


All times are GMT -5. The time now is 10:37 PM.