m_condition.mutex cannot be used in shared method ?

Marco Leise via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 19 06:51:49 PDT 2014


I have a thread that is shared by
others, so I have a shared method, inside of which I wrote:

final void opOpAssign(string op : "~")(ref StreamingObject item) shared
{
	synchronized (m_condition.mutex)
	{
		m_list.unshared ~= item;
		m_condition.notify();
	}
}

Error: non-shared method core.sync.condition.Condition.mutex is not callable using a shared object

Where exactly should my stuff stop to be shared so I can call .mutex ?

Btw.:
StreamingObject is a struct
unshared is a @property that casts away sharedness

-- 
Marco



More information about the Digitalmars-d-learn mailing list