On 1/26/21 4:40 PM, ludo wrote:
However, I think this is all moot, druntime is the same as Tango.
Moot you mean debatable? Or irrelevant :)
I *think* it's irrelevant. The comment makes it sound like it's slightly
different than Tango, but for sure reentrant locks are possible with D2
phobos
On Tuesday, 26 January 2021 at 21:09:34 UTC, Steven Schveighoffer
wrote:
The only item that is read without being locked is owner. If
you change that to an atomic read and write, it should be fine
(and is likely fine on x86* without atomics anyway).
All the other data is protected by the act
However, I think this is all moot, druntime is the same as
Tango.
Moot you mean debatable? Or irrelevant :) Thanks to your
explanations, I understand now that the dev tried to imitate a
Tango feature with very old D1 code. This is 2005/2009 code
And as pointed out by IGotD-, better not to me
On 1/26/21 3:56 PM, IGotD- wrote:
That code isn't thread safe at all (assuming FastLock is used from
several threads). lockCount isn't atomic which means the code will not
work with several threads.> Also the assignment of the variable owner
isn't thread safe. As soon you start to include more
On Tuesday, 26 January 2021 at 18:07:06 UTC, ludo wrote:
Hi guys,
still working on old D1 code, to be updated to D2. At some
point the previous dev wrote a FastLock class. The top comment
is from the dev himself, not me. My question is after the code.
---
class FastLock
{
protected
On 1/26/21 1:07 PM, ludo wrote:
Hi guys,
still working on old D1 code, to be updated to D2. At some point the
previous dev wrote a FastLock class. The top comment is from the dev
himself, not me. My question is after the code.
[snip]
Is it so that the
old Tango's mutex lock was not keepi
Hi guys,
still working on old D1 code, to be updated to D2. At some point
the previous dev wrote a FastLock class. The top comment is from
the dev himself, not me. My question is after the code.
---
class FastLock
{
protected Mutex mutex;
protected int lockCount;
prot