bug-hurd
[Top][All Lists]
Advanced

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]