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

Re: lock_kernel



On Sat, 19 May 2001, siva prasad wrote:

> Hi guys
> when the macro lock_kernel is defined as 
> do{ } while(0)
> and when it comes 'out' immediately('cos the condition
> is false by having specified 0) from the flow of
> control what is the rational behind using it?
> thanks

It is only defined like that on single-processor builds.
lock_kernel() is needed in some places to provide mutual
exclusion on SMP (multi-processor) systems. Have a look
at the other definition.

john

-- 
"ya* and ?IN? are the only things you need consider
 for project names."

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/