diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-09-29 19:45:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-09-29 19:45:35 +0000 |
commit | e3edbbc1448c77df5bd1a3cb6086b2784290ba79 (patch) | |
tree | 6a5b3d6694afa2595089795cca1134876645c40a /sys/dev/acpi | |
parent | a661fbd96e93c647ee981cfc9c3a54617012c2fa (diff) |
grab the acpi thread lock very early in acpi thread startup; not that it
is likely that anyone will race us... but why be careless.
ok kettenis
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index dc9f8fb1d6e..9aa906c8aba 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.212 2010/08/31 17:13:46 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.213 2010/09/29 19:45:34 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2002,6 +2002,8 @@ acpi_thread(void *arg) u_int32_t gpe; int s; + rw_enter_write(&sc->sc_lck); + /* * If we have an interrupt handler, we can get notification * when certain status bits changes in the ACPI registers, @@ -2033,8 +2035,6 @@ acpi_thread(void *arg) } } - rw_enter_write(&sc->sc_lck); - while (thread->running) { s = spltty(); while (sc->sc_threadwaiting) { |