Tim Wiederhake
d00d078968
virthread: Introduce virLockGuard
...
Locks a virMutex on creation and unlocks it in its destructor.
The VIR_LOCK_GUARD macro is used instead of "g_auto(virLockGuard)" to
work around a clang issue (see https://bugs.llvm.org/show_bug.cgi?id=3888
and https://bugs.llvm.org/show_bug.cgi?id=43482 ).
Typical usage:
void function(virMutex *m)
{
VIR_LOCK_GUARD lock = virLockGuardLock(m);
/* `m` is locked, and released automatically on scope exit */
...
while (expression) {
VIR_LOCK_GUARD lock2 = virLockGuardLock(...);
/* similar */
}
}
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-01 17:19:23 +01:00
..
2021-03-17 09:16:05 +00:00
2021-03-17 09:16:05 +00:00
2021-08-24 16:02:38 +02:00
2021-10-21 17:34:04 +01:00
2021-08-06 08:53:25 +02:00
2021-11-23 09:59:00 +01:00
2021-11-30 10:51:33 +00:00
2020-11-20 12:09:51 +00:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-10-25 12:48:46 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-10 16:36:25 +01:00
2021-12-10 16:36:25 +01:00
2021-11-08 14:32:32 +01:00
2021-04-13 17:00:38 +02:00
2021-12-13 14:44:01 +01:00
2021-08-17 12:35:45 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-04-19 11:21:40 +02:00
2021-11-22 12:39:59 +01:00
2021-11-11 16:16:17 +01:00
2021-04-14 12:06:16 +02:00
2021-04-14 12:06:16 +02:00
2022-01-05 14:08:40 +01:00
2021-10-12 10:26:00 +02:00
2021-04-13 17:00:38 +02:00
2022-01-17 09:53:45 +01:00
2022-01-17 09:53:45 +01:00
2021-09-22 14:53:55 +02:00
2021-09-22 14:53:55 +02:00
2022-01-05 16:32:28 +01:00
2022-01-05 14:08:39 +01:00
2021-09-21 14:30:19 +02:00
2021-09-21 12:25:42 +02:00
2022-01-18 16:50:31 +01:00
2022-01-18 16:18:57 +01:00
2021-02-05 00:20:43 -05:00
2021-12-01 13:39:47 +01:00
2021-12-01 13:39:47 +01:00
2021-06-04 10:56:06 +01:00
2021-03-05 15:01:29 +01:00
2021-10-10 18:42:15 +02:00
2020-08-07 12:43:56 +01:00
2021-03-02 09:50:19 +01:00
2021-04-13 17:00:38 +02:00
2021-07-27 10:29:20 +02:00
2021-07-27 10:29:20 +02:00
2021-12-01 13:53:12 +01:00
2021-04-13 17:00:38 +02:00
2021-12-13 13:37:31 -05:00
2021-12-13 13:37:31 -05:00
2021-12-13 13:37:31 -05:00
2021-12-13 13:37:31 -05:00
2021-12-13 14:44:01 +01:00
2021-04-13 17:00:38 +02:00
2020-11-09 23:42:33 +01:00
2021-04-13 17:00:38 +02:00
2021-02-11 17:05:32 +01:00
2021-02-11 17:05:32 +01:00
2021-12-01 13:53:12 +01:00
2021-12-01 13:53:12 +01:00
2021-03-02 09:50:19 +01:00
2021-12-14 16:04:17 +00:00
2021-12-14 16:04:17 +00:00
2021-10-01 10:58:27 +02:00
2021-10-01 10:58:27 +02:00
2021-02-02 15:00:55 +01:00
2021-09-08 16:19:55 +02:00
2021-05-13 11:07:40 +01:00
2021-05-13 11:07:16 +01:00
2021-12-13 13:37:31 -05:00
2021-12-13 13:37:31 -05:00
2021-12-14 16:41:36 +01:00
2022-01-03 13:14:43 +01:00
2022-01-03 13:14:43 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-01 13:53:12 +01:00
2021-04-13 17:00:38 +02:00
2022-01-19 15:32:54 +00:00
2022-01-05 14:08:40 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-22 13:48:35 +01:00
2021-09-09 18:06:13 +02:00
2021-08-06 08:53:25 +02:00
2021-04-13 17:00:38 +02:00
2021-12-06 13:04:28 -05:00
2021-08-09 10:09:00 +02:00
2022-01-28 20:38:44 +01:00
2022-01-04 16:40:10 +01:00
2021-06-01 14:30:39 +02:00
2021-09-21 14:09:44 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2020-12-15 13:35:33 -05:00
2022-01-28 20:38:44 +01:00
2022-01-18 17:48:32 +01:00
2022-01-18 17:48:32 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-02 15:17:27 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-14 16:41:36 +01:00
2021-12-10 16:36:24 +01:00
2021-05-17 15:54:13 +02:00
2021-08-06 08:53:25 +02:00
2021-04-13 17:00:38 +02:00
2021-12-01 13:53:12 +01:00
2021-04-13 17:00:38 +02:00
2021-12-06 13:04:28 -05:00
2021-12-06 13:04:28 -05:00
2021-11-03 14:46:54 +01:00
2021-10-21 17:34:04 +01:00
2021-10-21 17:34:04 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-08-05 11:18:09 +02:00
2021-08-05 11:18:09 +02:00
2021-11-23 12:51:09 +01:00
2021-11-23 12:51:09 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2022-01-20 17:51:07 +01:00
2022-01-06 16:03:55 +01:00
2021-12-10 16:36:25 +01:00
2021-10-12 10:26:00 +02:00
2021-05-13 11:07:13 +01:00
2021-05-13 11:07:13 +01:00
2021-08-06 08:53:25 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-08-26 09:16:44 +02:00
2021-04-13 17:00:38 +02:00
2020-11-06 15:03:39 +01:00
2021-11-08 14:32:32 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-11-24 09:20:38 +01:00
2021-05-13 11:07:47 +01:00
2021-04-13 17:00:38 +02:00
2021-02-03 13:07:13 +01:00
2021-02-03 13:07:13 +01:00
2021-08-20 15:00:53 +02:00
2021-12-13 13:37:31 -05:00
2021-12-13 13:37:31 -05:00
2021-04-12 15:55:09 +02:00
2021-04-12 15:55:09 +02:00
2021-09-21 12:25:42 +02:00
2021-09-21 12:25:42 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2021-12-01 13:53:12 +01:00
2021-04-13 17:00:38 +02:00
2022-02-01 17:19:23 +01:00
2022-02-01 17:19:23 +01:00
2021-12-01 14:36:29 +01:00
2021-10-27 17:11:29 +02:00
2021-12-10 16:36:25 +01:00
2021-12-01 12:14:03 +00:00
2021-03-22 12:44:18 +01:00
2021-04-13 17:00:38 +02:00
2021-04-13 17:00:38 +02:00
2022-01-07 08:07:04 +01:00
2021-04-13 17:00:38 +02:00
2021-08-06 08:53:25 +02:00
2021-04-13 17:00:38 +02:00
2022-01-19 13:57:59 +01:00
2022-01-19 13:57:59 +01:00
2020-12-04 16:24:19 +01:00
2020-12-04 16:24:19 +01:00
2020-11-02 22:01:36 -05:00
2022-01-21 16:42:13 +01:00
2021-11-24 09:20:39 +01:00