On Tuesday, 22 May 2018 at 21:45:07 UTC, IntegratedDimensions wrote:
an idea to lock data by removing the reference:

class A
{
   Lockable!Data data;
}

[...]

This sounds like you are looking for is an atomic swap. Afaik it doesn't exist in the standard library. You could use asm for the XCHG, but that would make your code x86 dependent.
I think the easiest way would be to just use a mutex and tryLock.

Reply via email to