[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [patch 02/10] qemu: mutex/thread/cond wrappers
From: |
malc |
Subject: |
Re: [Qemu-devel] [patch 02/10] qemu: mutex/thread/cond wrappers |
Date: |
Thu, 26 Mar 2009 14:01:06 +0300 (MSK) |
On Wed, 25 Mar 2009, Marcelo Tosatti wrote:
> Signed-off-by: Marcelo Tosatti <address@hidden>
>
> Index: trunk/qemu-thread.c
> ===================================================================
> --- /dev/null
> +++ trunk/qemu-thread.c
> @@ -0,0 +1,123 @@
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <errno.h>
> +#include <time.h>
> +#include <signal.h>
> +#include <stdint.h>
> +#include "qemu-thread.h"
> +
> +static void error_exit(const char *msg)
> +{
> + perror(msg);
> + exit(1);
> +}
> +
> +void qemu_mutex_init(QemuMutex *mutex)
> +{
> + if (pthread_mutex_init(&mutex->lock, NULL))
> + error_exit(__func__);
> +}
This is wrong, pthread functions return the error code and do not
set the errno thus using perror is meaningless.
[..snip..]
--
mailto:address@hidden
- [Qemu-devel] [patch 00/10] iothread (candidate for inclusion), Marcelo Tosatti, 2009/03/25
- [Qemu-devel] [patch 01/10] qemu: create helper for event notification, Marcelo Tosatti, 2009/03/25
- [Qemu-devel] [patch 02/10] qemu: mutex/thread/cond wrappers, Marcelo Tosatti, 2009/03/25
- [Qemu-devel] [patch 03/10] qemu: per-arch cpu_has_work, Marcelo Tosatti, 2009/03/25
- [Qemu-devel] [patch 04/10] qemu: introduce main_loop_break, Marcelo Tosatti, 2009/03/25
- [Qemu-devel] [patch 06/10] qemu: per-cpu thread information, Marcelo Tosatti, 2009/03/25