I am trying to add a new slot to the lock class. This is useful because I have a lot of locks in a hierarchy and if I store the parent lock for every lock it becomes easier to detect problems while debugging.
Unfortunately, this apparently can't be done with the ensure-class function. I can add slots to 'process, but not to 'lock, because it is listed as a built-in-class. See my earlier question here for how to do it for 'process: lisp, CLOS: adding a slot to the process class
Do you know how to solve this problem? If it is not possible, the only alternative I can think of is storing the hierarchical relation of locks in a hash-table, but since some of the locks are created at runtime and in different processes, I would have to add yet another lock just to access the hashtable that stores metadata on the locks.
This strikes me as terribly inefficient. Do you have a better idea?
edit: for clarification, I am using Clozure Common Lisp.