Re: semaphore down/up

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

 




On Tue, 2004-07-20 at 21:56, Hinko Kocevar wrote: Hi,

Looking at scull_read() in LDD2 how is semaphore released if the read operation succeeds ? I mean, up is invoked only if error occours so lines after out: label are called. As I understand this example, out: label could be reached if doing multiple scull_read() in a loop, and it would fail if either EOF is reached or no data is available in private_data.

It puzzles me because it is stated on a page before that claimed
semaphore must be released as well (that makes sense).

But he IS releasing the semaphore, in the stmt after the label, remember that the stmt after
out: will also be read even in the case of normal execution of code in that fxn.



regards, h

HTH, - mandeep

_________________________________________________________________
Apply to 50,000 jobs now. http://go.msnserver.com/IN/46921.asp Post your CV on naukri.com today.



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