Thread (30 messages) 30 messages, 10 authors, 2006-02-18

Re: [PATCH, RFC] [1/3] Generic in-kernel AC status

From: Philipp Matthias Hahn <hidden>
Date: 2006-02-08 22:26:04
Also in: linux-acpi, lkml

Hi!

On Wed, Feb 08, 2006 at 01:04:22PM +0000, Matthew Garrett wrote:
quoted hunk ↗ jump to hunk
diff --git a/include/linux/pm.h b/include/linux/pm.h
...
+void pm_set_ac_status(int (*ac_status_function)(void))
+{
+	down(&pm_sem);
+	get_ac_status = ac_status_function;
+	up(&pm_sem);
+}
Why do you need a semaphore/mutex, when you only do one assignment,
which is atomic by itself?

BYtE
Philipp
-- 
  / /  (_)__  __ ____  __ Philipp Hahn
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ pmhahn@titan.lahn.de
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help