linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question regarding mutex locking
@ 2007-11-28  4:37 Larry Finger
  2007-11-28  8:10 ` Matthias Kaehlcke
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Larry Finger @ 2007-11-28  4:37 UTC (permalink / raw)
  To: LKML

If a particular routine needs to lock a mutex, but it may be entered with that mutex already locked,
would the following code be SMP safe?

hold_lock = mutex_trylock()

...

if (hold_lock)
	mutex_unlock()

Thanks,

Larry

^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <fa.C9TdvYAhY8SablNc39IpD8WDnNM@ifi.uio.no>]

end of thread, other threads:[~2007-11-30  1:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28  4:37 Question regarding mutex locking Larry Finger
2007-11-28  8:10 ` Matthias Kaehlcke
2007-11-28 14:46   ` Larry Finger
2007-11-28 15:00     ` Matthias Kaehlcke
2007-11-28 15:22 ` Andreas Schwab
2007-11-28 15:41   ` Larry Finger
2007-11-28 22:45     ` Jarek Poplawski
2007-11-28 22:56       ` Jarek Poplawski
2007-11-28 23:07         ` Jarek Poplawski
2007-11-28 23:33       ` Stephen Hemminger
2007-11-29  6:40         ` Jarek Poplawski
2007-11-30  1:13 ` Bryan O'Sullivan
     [not found] <fa.C9TdvYAhY8SablNc39IpD8WDnNM@ifi.uio.no>
2007-11-28  4:53 ` Robert Hancock
2007-11-28  5:19   ` Larry Finger
2007-11-29  2:34     ` David Schwartz
2007-11-29  7:56       ` Jarek Poplawski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).