If the mutex should be accessible by itself then just give it a name:
synchronized(foo_mutex) mixed foo;
/ Martin Stjernholm, Roxen IS
Previous text:
2003-02-06 10:20: Subject: synchronized
I like that. One could also give them an identifier so that they can be locked outside the object, and used for objects overloading `[]. (Say, "`mutex_lock <variable>".)
class A { syncronized mixed foo; }
A a=A(); syncronized(a->foo) { ... }
But now it gets tricky to implement. :) But not that tricky, since syncronized() already must take an lvalue.
/ Mirar