[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 52/66] kern/debug.c: initialize the lock
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 52/66] kern/debug.c: initialize the lock |
Date: |
Mon, 9 Dec 2013 00:17:01 +0900 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Marin Ramesa, le Thu 05 Dec 2013 22:03:46 +0100, a écrit :
> * kern/debug.c (Assert_print_lock): Initialize the lock.
It is actually initialized to zero, which happens to be the correct
value.
> @@ -58,6 +58,7 @@ void
> Assert(char *exp, char *file, int line)
> {
> #if NCPUS > 1
> + simple_lock_init(&Assert_print_lock);
> simple_lock(&Assert_print_lock);
This is always wrong to initialize a mutex just before locking it: it
will always be available, since it has just been initialized...
> printf("{%d} Assertion failed: file \"%s\", line %d\n",
> cpu_number(), file, line);
> --
> 1.8.1.4
>
>
--
Samuel
<N> (* If you have a precise idea of the intended use of the following code,
please
<N> write to Eduardo.Gimenez@inria.fr and ask for the prize :-)
<N> -- Eduardo (11/8/97) *)
-+- N sur #ens-mim - et c'était un des développeurs -+-
- [PATCH 44/66] i386/i386at/rtc.c: remove unused variable, (continued)
- [PATCH 44/66] i386/i386at/rtc.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 45/66] i386/intel/pmap.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 47/66] ipc/ipc_init.c: qualify constant with const, Marin Ramesa, 2013/12/05
- [PATCH 46/66] i386/intel/pmap.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 48/66] ipc/mach_port.c: use boolean instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 49/66] ipc/port.h: update comment, Marin Ramesa, 2013/12/05
- [PATCH 50/66] kern/act.c, act.h: comment unused variable, Marin Ramesa, 2013/12/05
- [PATCH 51/66] kern/act.h: remove prototype without definition, Marin Ramesa, 2013/12/05
- [PATCH 52/66] kern/debug.c: initialize the lock, Marin Ramesa, 2013/12/05
- Re: [PATCH 52/66] kern/debug.c: initialize the lock,
Samuel Thibault <=
- [PATCH 53/66] kern/debug.c: initialize panicstr, Marin Ramesa, 2013/12/05
- [PATCH 54/66] kern/debug.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 55/66] kern/lock_mon.c: remove unused variable, Marin Ramesa, 2013/12/05
- [PATCH 57/66] kern/lock_mon.c: remove dead assignments, Marin Ramesa, 2013/12/05
- [PATCH 56/66] kern/lock_mon.c: use spl_t instead of an int, Marin Ramesa, 2013/12/05
- [PATCH 58/66] kern/pc_sample.c: remove unused variables, Marin Ramesa, 2013/12/05
- [PATCH 59/66] kern/priority.c: update comment, Marin Ramesa, 2013/12/05
- [PATCH 60/66] kern/rbtree.h: remove unnecessary include, Marin Ramesa, 2013/12/05