How to use containers in lock based concurrency

ANtlord antlord92 at gmail.com
Fri Nov 3 12:42:29 UTC 2017


Hello! I can't get how to use double linked list in concurrency. 
Please help.

Providing code


import std.stdio;
import std.container;


synchronized class SocksQueue {
     private shared(DList!string) _queue;
     public void f(string data) {
         this._queue.insertFront(data);
     }
}

void main(string[] args)
{
}

I get a compile error onlineapp.d(8): Error: template 
std.container.dlist.DList!string.DList.insertFront cannot deduce 
function from argument types !()(string) shared, candidates are:
/dlang/dmd/linux/bin64/../../src/phobos/std/container/dlist.d(441):        std.container.dlist.DList!string.DList.insertFront(Stuff)(Stuff stuff)

https://run.dlang.io/gist/3afff560fe3b2f439272c3ee3adcebd0?compiler=dmd


More information about the Digitalmars-d-learn mailing list