Re: [libvirt] [PATCH 3/5] closeCallback is already lockable, initialize it as such
On Mon, Apr 13, 2015 at 16:33:50 +0200, Martin Kletzander wrote: Luckily we are allocating structs as clean memory and PTHREAD_MUTEX_INITIALIZER is { 0 }, so nothing happened, but it should still be created as lockable object. Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/datatypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 0f535b4..dc024f8 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -1,7 +1,7 @@ /* * datatypes.c: management of structs for public data types * - * Copyright (C) 2006-2014 Red Hat, Inc. + * Copyright (C) 2006-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public In patches like this, the emacs year bumper script makes it twice the size. @@ -113,7 +113,7 @@ virGetConnect(void) if (!(ret = virObjectNew(virConnectClass))) return NULL; -if (!(ret-closeCallback = virObjectNew(virConnectCloseCallbackDataClass))) +if (!(ret-closeCallback = virObjectLockableNew(virConnectCloseCallbackDataClass))) goto error; if (virMutexInit(ret-lock) 0) ACK, Peter signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/5] closeCallback is already lockable, initialize it as such
On Wed, Apr 15, 2015 at 09:29:39AM +0200, Peter Krempa wrote: On Mon, Apr 13, 2015 at 16:33:50 +0200, Martin Kletzander wrote: Luckily we are allocating structs as clean memory and PTHREAD_MUTEX_INITIALIZER is { 0 }, so nothing happened, but it should still be created as lockable object. Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/datatypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 0f535b4..dc024f8 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -1,7 +1,7 @@ /* * datatypes.c: management of structs for public data types * - * Copyright (C) 2006-2014 Red Hat, Inc. + * Copyright (C) 2006-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public In patches like this, the emacs year bumper script makes it twice the size. But only once a year and we're hyper-compliant after that ;) @@ -113,7 +113,7 @@ virGetConnect(void) if (!(ret = virObjectNew(virConnectClass))) return NULL; -if (!(ret-closeCallback = virObjectNew(virConnectCloseCallbackDataClass))) +if (!(ret-closeCallback = virObjectLockableNew(virConnectCloseCallbackDataClass))) goto error; if (virMutexInit(ret-lock) 0) ACK, Peter signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 3/5] closeCallback is already lockable, initialize it as such
Luckily we are allocating structs as clean memory and PTHREAD_MUTEX_INITIALIZER is { 0 }, so nothing happened, but it should still be created as lockable object. Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/datatypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 0f535b4..dc024f8 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -1,7 +1,7 @@ /* * datatypes.c: management of structs for public data types * - * Copyright (C) 2006-2014 Red Hat, Inc. + * Copyright (C) 2006-2015 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -113,7 +113,7 @@ virGetConnect(void) if (!(ret = virObjectNew(virConnectClass))) return NULL; -if (!(ret-closeCallback = virObjectNew(virConnectCloseCallbackDataClass))) +if (!(ret-closeCallback = virObjectLockableNew(virConnectCloseCallbackDataClass))) goto error; if (virMutexInit(ret-lock) 0) -- 2.3.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list