On 27 April 2014 17:26, Michael Tokarev <m...@tls.msk.ru> wrote:
> Replace QemuMutex with GMutex and QemuCond with GCond
> (with corresponding function changes), to make libcacard
> independent of qemu internal functions.

> --- a/libcacard/event.c
> +++ b/libcacard/event.c
> @@ -43,13 +43,13 @@ vevent_delete(VEvent *vevent)
>
>  static VEvent *vevent_queue_head;
>  static VEvent *vevent_queue_tail;
> -static QemuMutex vevent_queue_lock;
> -static QemuCond vevent_queue_condition;
> +static GMutex vevent_queue_lock;
> +static GCond vevent_queue_condition;
>
>  void vevent_queue_init(void)
>  {
> -    qemu_mutex_init(&vevent_queue_lock);
> -    qemu_cond_init(&vevent_queue_condition);
> +    g_mutex_init(&vevent_queue_lock);
> +    g_cond_init(&vevent_queue_condition);
>      vevent_queue_head = vevent_queue_tail = NULL;
>  }

Just to record a conversation from IRC: this won't
compile on older versions of glib, because those don't
support g_cond_init(). Conversely, if you use g_cond_new()
then newer glib will complain that it's deprecated.
trace/simple.c has an example of how you have to work
around this API churn...

thanks
-- PMM

Reply via email to