[Issue 7902] New: [TDPL] sychronized is supposed to be for classes, not functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 13 21:19:45 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7902

           Summary: [TDPL] sychronized is supposed to be for classes, not
                    functions
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-04-13 21:20:33 PDT ---
Per TDPL (p. 414 - 419), synchronized is supposed to be on classes, not
functions. It specifically talks about how D makes all of a class' function
synchronized or none of them, as well as how that affects member variables.
However, dmd seems to currently only apply synchronized to functions. This
should be illegal:

class C
{
    synchronized int foo() {return 42;}

    bool bar() {return false;}
}

But it compiles. As opposed to what it should be

synchronized class C
{
    int foo() {return 42;}

    bool bar() {return false;}
}

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


More information about the Digitalmars-d-bugs mailing list