proper way to create an initialized semaphore?

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

 



  i'm perusing r. love's kernel book and comparing to the kernel
source, and i noticed that love's book talks about creating and
initializing a semaphore with:

  DECLARE_SEMAPHORE_GENERIC(name, count)

the current kernel, however, has no such per-architecture macro.
there, it's called __DECLARE_SEMAPHORE_GENERIC() instead.  is that
just a typo in love's book?  or was that macro renamed at some point?

  and if that latter macro is supposed to be used, why the leading
underscores in the name?  it's kind of awkward, no?  given that you
can declare mutexes with one of:

  DECLARE_MUTEX(name);
  DECLARE_MUTEX_LOCKED(name);

i'm puzzled as to why there's no equally convenient macro for general
semaphores. unless that "__DECLARE_..." macro *is* what you're
supposed to use.

rday


-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://www.fsdev.dreamhosters.com/wiki/index.php?title=Main_Page
========================================================================

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