Hi Jan,
Jan Beulich writes:
> On 17.02.2023 02:56, Volodymyr Babchuk wrote:
>> Jan Beulich writes:
>>> On 31.08.2022 16:10, Volodymyr Babchuk wrote:
--- /dev/null
+++ b/xen/include/xen/refcnt.h
@@ -0,0 +1,28 @@
+#ifndef __XEN_REFCNT_H__
+#define __XEN_REFCNT_H__
On 17.02.2023 02:56, Volodymyr Babchuk wrote:
> Jan Beulich writes:
>> On 31.08.2022 16:10, Volodymyr Babchuk wrote:
>>> --- /dev/null
>>> +++ b/xen/include/xen/refcnt.h
>>> @@ -0,0 +1,28 @@
>>> +#ifndef __XEN_REFCNT_H__
>>> +#define __XEN_REFCNT_H__
>>> +
>>> +#include
>>> +
>>> +typedef atomic_
Hello Jan,
Jan Beulich writes:
> On 31.08.2022 16:10, Volodymyr Babchuk wrote:
>> --- /dev/null
>> +++ b/xen/include/xen/refcnt.h
>> @@ -0,0 +1,28 @@
>> +#ifndef __XEN_REFCNT_H__
>> +#define __XEN_REFCNT_H__
>> +
>> +#include
>> +
>> +typedef atomic_t refcnt_t;
>
> Like Linux has it, I think
On 31.08.2022 16:10, Volodymyr Babchuk wrote:
> --- /dev/null
> +++ b/xen/include/xen/refcnt.h
> @@ -0,0 +1,28 @@
> +#ifndef __XEN_REFCNT_H__
> +#define __XEN_REFCNT_H__
> +
> +#include
> +
> +typedef atomic_t refcnt_t;
Like Linux has it, I think this would better be a separate struct. At
least i
We can use reference counter to ease up object lifetime management.
This patch adds very basic support for reference counters. refcnt
should be used in the following way:
1. Protected structure should have refcnt_t field
2. This field should be initialized with refcnt_init() during object
constru