提交 6dfbaca7 编写于 作者: M Martin Kletzander

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: NMartin Kletzander <mkletzan@redhat.com>
上级 5336a3a4
/*
* 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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册