[armedbear-cvs] r12037 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Sat Jul 11 12:46:08 UTC 2009
Author: ehuelsmann
Date: Sat Jul 11 08:46:04 2009
New Revision: 12037
Log:
Add a method to LispObject to be used with the Java locking API.
Modified:
trunk/abcl/src/org/armedbear/lisp/JavaObject.java
trunk/abcl/src/org/armedbear/lisp/LispObject.java
Modified: trunk/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaObject.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/JavaObject.java Sat Jul 11 08:46:04 2009
@@ -176,6 +176,16 @@
return javaInstance();
}
+ /** Returns the encapsulated Java object for
+ * interoperability with wait, notify, synchronized, etc.
+ *
+ * @return The encapsulated object
+ */
+ @Override
+ public Object lockableInstance() {
+ return obj;
+ }
+
public static final Object getObject(LispObject o)
throws ConditionThrowable
{
Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java Sat Jul 11 08:46:04 2009
@@ -112,6 +112,19 @@
" is not of class " + c.getName()));
}
+ /** This method returns 'this' by default, but allows
+ * objects to return different values to increase Java
+ * interoperability
+ *
+ * @return An object to be used with synchronized, wait, notify, etc
+ * @throws org.armedbear.lisp.ConditionThrowable
+ */
+ public Object lockableInstance() throws ConditionThrowable
+ {
+ return this;
+ }
+
+
public LispObject car() throws ConditionThrowable
{
return type_error(this, Symbol.LIST);
More information about the armedbear-cvs
mailing list