www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3891] New: core.Thread constructors don't accept shared delegates

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3891

           Summary: core.Thread constructors don't accept shared delegates
           Product: D
           Version: 2.030
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: Justin.SpahrSummers gmail.com



2010-03-07 22:37:07 CST ---
It seems logical that Thread objects should be constructed with delegates
marked "shared," but there's no way to do this right now:

---
import core.thread;

class A {
    void doSomethingMultithreaded () shared {
        // blah blah
    }
}

void main () {
    auto a = new shared(A)();
    auto t = new Thread(&a.doSomethingMultithreaded);
    t.start();
}
---

Even in lieu of making it mandatory, an overloaded constructor making use of
this would be helpful.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 07 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3891




2010-03-07 22:51:11 CST ---
Just noticed this newsgroup post too:
http://www.digitalmars.com/d/archives/digitalmars/D/Concurrency_architecture_for_D2_104120.html#N104479

Which I guess makes this whole report moot.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 07 2010