1) Please specify which Lisp implementation you are using. Locks are not
standardized, so what you want to do may depend a lot on the concrete
implementation.
2) Can you subclass the lock class, or define a new struct that includes
the lock struct? Maybe this is good enough for your purposes if you are
able to use your own extension without messing with the internals of an
existing class or struct. The latter may have unexpected consequences.
3) Many Lisp implementations provide lock-free hashtables that guarantee
consistency in parallel / multi-threaded environments without the need
to use locks. I'm pretty sure that LispWorks and Clozure support this,
but there are quite likely others as well. Also consider using weak
hashtables, so you don't prevent the locks from being garbage-collected.
Pascal
--
My website:
http://p-cos.net
Common Lisp Document Repository:
http://cdr.eurolisp.org
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/
The views expressed are my own, and not those of my employer.