Re: shared and cryptic error messages

2011-03-31 Thread Jose Armando Garcia
On Thu, Mar 31, 2011 at 7:59 PM, Jason House wrote: > Jose Armando Garcia Wrote: > >> On Wed, Mar 30, 2011 at 9:39 PM, Jason House >> wrote: >> > Jose Armando Garcia Wrote: >> > >> >> How do I get around this error? >> > >> > That's not easy to answer...  To get the compiler to shut up, you can c

Re: shared and cryptic error messages

2011-03-31 Thread Jason House
Jose Armando Garcia Wrote: > On Wed, Mar 30, 2011 at 9:39 PM, Jason House > wrote: > > Jose Armando Garcia Wrote: > > > >> How do I get around this error? > > > > That's not easy to answer...  To get the compiler to shut up, you can copy > > and paste FILE's destructor and mark it as shared.  Of

Re: shared and cryptic error messages

2011-03-31 Thread Jose Armando Garcia
On Wed, Mar 30, 2011 at 9:39 PM, Jason House wrote: > Jose Armando Garcia Wrote: > >> Why am I getting this error? I suspect that synchronized is the >> problem. > > A synchronized class is implicitly shared and most of the methods are > synchronized.  I say most because at a minimum, the constru

Re: shared and cryptic error messages

2011-03-31 Thread Jose Armando Garcia
Adding a shared dtor to File doesn't sound like the correct solution. On Wed, Mar 30, 2011 at 8:14 PM, KennyTM~ wrote: > On Mar 31, 11 06:34, Jason House wrote: >> >> he compiler wants "argument types () shared" instead of "argument types >> ()". It's an awful error message, and I'm certain I fil

Re: shared and cryptic error messages

2011-03-31 Thread Jose Armando Garcia
First of all, thanks for the reply. That means that it is imposible to use a struct or class that overrides ~this() inside of a synchronized class. As long as I take the extra care of making sure that I don't expose an object of this class/struct outside of the synchronized class. It is impossible

Re: shared and cryptic error messages

2011-03-30 Thread Andrej Mitrovic
TLS takes some time to getting used to. Doing multithreading in a way forces me to stop using globals, because I always get bitten when spawning new threads and only later realizing that my globals have been re-initialized to their .init value. The new thread ends up reading mostly zero-initialized

Re: shared and cryptic error messages

2011-03-30 Thread Jason House
Jose Armando Garcia Wrote: > Why am I getting this error? I suspect that synchronized is the > problem. A synchronized class is implicitly shared and most of the methods are synchronized. I say most because at a minimum, the constructor isn't synchronized on anything. As you probably know sh

Re: shared and cryptic error messages

2011-03-30 Thread Jason House
KennyTM~ Wrote: > On Mar 31, 11 06:34, Jason House wrote: > > he compiler wants "argument types () shared" instead of "argument types > > ()". It's an awful error message, and I'm certain I filed a bug for it at > > least a year ago. In the toy example, mark the destructor as shared, and it > >

Re: shared and cryptic error messages

2011-03-30 Thread KennyTM~
On Mar 31, 11 06:34, Jason House wrote: he compiler wants "argument types () shared" instead of "argument types ()". It's an awful error message, and I'm certain I filed a bug for it at least a year ago. In the toy example, mark the destructor as shared, and it should compile. Yes you have. h

Re: shared and cryptic error messages

2011-03-30 Thread Jason House
he compiler wants "argument types () shared" instead of "argument types ()". It's an awful error message, and I'm certain I filed a bug for it at least a year ago. In the toy example, mark the destructor as shared, and it should compile. Jose Armando Garcia Wrote: > It looks like the following

shared and cryptic error messages

2011-03-30 Thread Jose Armando Garcia
import std.stdio; class B { private File file; } synchronized class A { private File file; } void main() { } /usr/include/d/dmd/phobos/std/stdio.d(292): Error: destructor std.stdio.File.~this () is not callable using argument types () Why am I getting this error? I suspect that synchronized

Re: shared and cryptic error messages

2011-03-30 Thread Jose Armando Garcia
It looks like the following works: struct B {} synchronized class A { private B b } but this doesn't: struct B { ~this() {} } synchronized class A { private B b } On Wed, Mar 30, 2011 at 4:59 PM, Jose Armando Garcia wrote: > import std.stdio; > > class B > { >  private File file; > } > synchro