From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Reference counter in smart pointers are not updated properly when used by multiple tasks
Date: Thu, 1 Feb 2018 11:51:49 +0100
Date: 2018-02-01T11:51:49+01:00 [thread overview]
Message-ID: <p4urg5$gnq$1@gioia.aioe.org> (raw)
In-Reply-To: 11a39ccf-dc16-4972-8a0f-3fdd49b18124@googlegroups.com
On 01/02/2018 11:28, onox wrote:
> I'm replaced the Atomic.Unsigned_32 with:
>
> protected type Reference_Counter is
> procedure Increment;
> procedure Decrement (Result : out Natural);
> function Count return Natural;
> private
> References : Natural := 1;
> end Reference_Counter;
>
> type Reference_Counter_Access is access Reference_Counter;
>
> type Data_Record is record
> References : Reference_Counter_Access;
There is System.Atomic_Counters I suppose from GNAT you could use.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2018-02-01 10:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 5:52 Reference counter in smart pointers are not updated properly when used by multiple tasks onox
2018-02-01 8:39 ` Dmitry A. Kazakov
2018-02-01 10:01 ` onox
2018-02-01 10:28 ` onox
2018-02-01 10:51 ` Dmitry A. Kazakov [this message]
2018-02-01 10:57 ` Dmitry A. Kazakov
2018-02-01 8:41 ` Simon Wright
2018-02-01 14:48 ` Jeffrey R. Carter
2018-02-01 19:37 ` onox
2018-02-01 20:12 ` Jeffrey R. Carter
2018-02-02 0:09 ` Randy Brukardt
2018-02-01 19:04 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox