mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
remote_driver: Return 'virLockGuard' from 'remoteDriverLock'
The function currently didn't have a return value. Returning the 'virLockGuard' struct allows the callers to use automatic unlocking of the mutex. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
1be393d9ad
commit
8d7e3a723d
@ -105,9 +105,17 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
static void remoteDriverLock(struct private_data *driver)
|
||||
/**
|
||||
* remoteDriverLock:
|
||||
* @driver: private data of the remote driver
|
||||
*
|
||||
* Locks the internal mutex of the private driver. Callers may optionally use
|
||||
* the returned virLockGuard struct to automatically unlock the driver.
|
||||
*/
|
||||
static virLockGuard
|
||||
remoteDriverLock(struct private_data *driver)
|
||||
{
|
||||
virMutexLock(&driver->lock);
|
||||
return virLockGuardLock(&driver->lock);
|
||||
}
|
||||
|
||||
static void remoteDriverUnlock(struct private_data *driver)
|
||||
|
Loading…
Reference in New Issue
Block a user