www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4834] New: Implicit sharing via delegates in std.concurrency

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

           Summary: Implicit sharing via delegates in std.concurrency
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2010-09-06 19:26:07 PDT ---
The following code compiles and should not, because it allows implicit sharing
of data between threads in the supposedly safe std.concurrency:

import std.concurrency;

void runDelegate(void delegate() dg) {
    dg();
}

class Foo {
    uint num;

    void incNum() {
        num++;
    }
}

void main() {
    auto foo = new Foo;
    spawn(&runDelegate, &foo.incNum);
}

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


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from David Simcha <dsimcha yahoo.com> 2010-09-07 16:07:02 PDT ---
http://dsource.org/projects/phobos/changeset/1964

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