synchronized (this[.classinfo]) in druntime and phobos
José Armando García Sancio
jsancio at gmail.com
Wed May 30 14:42:47 PDT 2012
On Wed, May 30, 2012 at 5:30 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> All deadlocks involving A and B mutexes. Or if not, can you show how? I
> can't see it.
>
> -Steve
This can cause a deadlock because locking order is not guaranteed, no?
synchronized class A {
void delegate(B b) { b.call() }
void call() {}
}
synchronized class B {
void delegate(A a) { a.call() }
void call() {}
}
Thanks,
-Jose
PS. This may not compile not sure if it should be 'void
delegate(shared B b)', etc.
More information about the Digitalmars-d
mailing list