[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
https://issues.dlang.org/show_bug.cgi?id=3089 Andrei Alexandrescu changed: What|Removed |Added Version|2.030 |D2 --
[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
http://d.puremagic.com/issues/show_bug.cgi?id=3089 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||WORKSFORME --- Comment #5 from Walter Bright 2009-10-28 11:30:10 PDT --- Works in dmd 2.035. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
http://d.puremagic.com/issues/show_bug.cgi?id=3089 --- Comment #4 from Jason House 2009-10-28 10:55:53 PDT --- (In reply to comment #3) > To the best of my knowledge, currently, shared does not imply synchronized, > though synchronized implies shared. Shared only provides the correct memory > fences. Shared structs/arrays are important for lock-free algorithms. That's the exact use case I want to do! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
http://d.puremagic.com/issues/show_bug.cgi?id=3089 --- Comment #3 from Rob Jacques 2009-10-28 10:06:11 PDT --- To the best of my knowledge, currently, shared does not imply synchronized, though synchronized implies shared. Shared only provides the correct memory fences. Shared structs/arrays are important for lock-free algorithms. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
http://d.puremagic.com/issues/show_bug.cgi?id=3089 --- Comment #2 from Sobirari Muhomori 2009-10-28 09:55:31 PDT --- That's because struct has no monitor member, so the callee can't lock it for exclusive access. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3089] Error: f.bar can only be called on a mutable object, not shared(foo)
http://d.puremagic.com/issues/show_bug.cgi?id=3089 Rob Jacques changed: What|Removed |Added CC||sandf...@jhu.edu OS/Version|Linux |All --- Comment #1 from Rob Jacques 2009-08-07 14:43:50 PDT --- I've found const functions are callable on shared objects: struct foo{ int bar() const { return 1; } } void main(){ shared foo f; auto x = f.bar; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---