January 06, 2002 synchronized functions bug | ||||
|---|---|---|---|---|
| ||||
It seems that synched functions always return 0. Try this:
import stdio;
class Synched
{
synchronized int synched() { return 666; }
}
int main()
{
Synched synched = new Synched;
printf("%d\n", synched.synched());
return 0;
}
Took me about an hour to figure out why the hell the newly allocated object suddenly turns to be null... =)
A pity this doesn't work yet: I wanted to make stream.d (and my new socket.d, socket streams) at least partially thread-safe, but no luck.
| ||||
January 07, 2002 Re: synchronized functions bug | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | Ok, I'll have a look. -Walter "Pavel Minayev" <evilone@omen.ru> wrote in message news:a1a5ga$2r3a$1@digitaldaemon.com... > It seems that synched functions always return 0. Try this: > > import stdio; > > class Synched > { > synchronized int synched() { return 666; } > } > > int main() > { > Synched synched = new Synched; > printf("%d\n", synched.synched()); > return 0; > } > > Took me about an hour to figure out why the hell the newly allocated object suddenly turns to be null... =) > > A pity this doesn't work yet: I wanted to make stream.d (and my new socket.d, socket streams) at least partially thread-safe, but no luck. > > | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply