Hmmm. BEGIN HUBBE Another reason is that now I can hopefully avoid implementing a bunch of keywords that can be done as function calls instead, example: syncronized { }
becomes: mutex->lock() { }
(I am fixing mutex->lock() to allow a function argument) END HUBBE
mutex->lock doesn't take a function argument yet, does it?
/ Martin Nilsson (Åskblod)
Previous text:
2003-02-04 22:56: Subject: synchronized
mixed synchronized(Thread.Mutex|mapping m, function f) { mixed r; if(mappingp(m)) m = m->_mutex; object key = m->lock(); r = f(); destruct(key); return r; }
mapping foo; void do_something() { synchronized(foo) { work on foo }; }
should work already, provided you place a mutex in the mapping under the index "_mutex" (or whatever index you choose to look under in the method "synchronized").
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)