[armedbear-cvs] r12053 - in trunk/abcl: . src/org/armedbear/lisp

Mark Evenson mevenson at common-lisp.net
Tue Jul 21 09:43:32 UTC 2009


Author: mevenson
Date: Tue Jul 21 05:43:29 2009
New Revision: 12053

Log:
Move additional symbols into THREADS package.

The symbols

  THREADP THREAD-UNLOCK THREAD-LOCK THREAD-NAME THREAD-ALIVE-P
  CURRENT-THREAD DESTROY-THREAD INTERRUPT-THREAD WITH-THREAD-LOCK
  MAKE-THREAD-LOCK MAKE-THREAD INTERRUPT-THREAD
  MAPCAR-THREADS
  GET-MUTEX MAKE-MUTEX WITH-MUTEX RELEASE-MUTEX

have been moved from EXTENSIONS into THREADS.

These primitives are still part of the EXTENSIONS package but are now
to be considered as deprecated, marked to be removed with 0.22.


Removed:
   trunk/abcl/src/org/armedbear/lisp/Gate.java
Modified:
   trunk/abcl/CHANGES
   trunk/abcl/src/org/armedbear/lisp/Autoload.java
   trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
   trunk/abcl/src/org/armedbear/lisp/Lisp.java
   trunk/abcl/src/org/armedbear/lisp/Mutex.java
   trunk/abcl/src/org/armedbear/lisp/Symbol.java
   trunk/abcl/src/org/armedbear/lisp/ThreadLock.java
   trunk/abcl/src/org/armedbear/lisp/autoloads.lisp
   trunk/abcl/src/org/armedbear/lisp/with-mutex.lisp
   trunk/abcl/src/org/armedbear/lisp/with-thread-lock.lisp

Modified: trunk/abcl/CHANGES
==============================================================================
--- trunk/abcl/CHANGES	(original)
+++ trunk/abcl/CHANGES	Tue Jul 21 05:43:29 2009
@@ -1,8 +1,27 @@
 Version 0.16.0
   Summary of changes:
-  * Implementation of Franz Allegro CL Gates MP primitive (Tobias Rittweiler).
-  * improve performance of CLOS eql-specializers (Anton Vodonosov).
+  * Improve performance of CLOS eql-specializers via cache (Anton Vodonosov).
   * 'build-from-lisp.sh' shell script (Tobias Rittweiler).
+  * New threading primitives aligned with Java/JVM constructs (Erik Huselman)
+
+      SYNCHRONIZED-ON
+      OBJECT-NOTIFY
+      OBJECT-NOTIFY-ALL
+
+  * THREADS package created to hold threads related primitives:	
+
+      THREADP THREAD-UNLOCK THREAD-LOCK THREAD-NAME THREAD-ALIVE-P
+      CURRENT-THREAD DESTROY-THREAD INTERRUPT-THREAD WITH-THREAD-LOCK
+      MAKE-THREAD-LOCK MAKE-THREAD INTERRUPT-THREAD
+
+      MAPCAR-THREADS
+      
+      GET-MUTEX MAKE-MUTEX WITH-MUTEX RELEASE-MUTEX
+
+    These primitives are still part of the EXTENSIONS package but are
+    now to be considered as deprecated, marked to be removed with
+    0.22.
+
   
 Version 0.15.0
 (07 Jun, 2009) 

Modified: trunk/abcl/src/org/armedbear/lisp/Autoload.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Autoload.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Autoload.java	Tue Jul 21 05:43:29 2009
@@ -489,34 +489,23 @@
         autoload(PACKAGE_EXT, "arglist", "arglist", true);
         autoload(PACKAGE_EXT, "assq", "assq", true);
         autoload(PACKAGE_EXT, "assql", "assql", true);
-        autoload(PACKAGE_EXT, "close-gate", "Gate", true);
         autoload(PACKAGE_EXT, "file-directory-p", "probe_file", true);
         autoload(PACKAGE_EXT, "gc", "gc", true);
         autoload(PACKAGE_EXT, "get-floating-point-modes", "FloatFunctions", true);
-        autoload(PACKAGE_EXT, "get-mutex", "Mutex", true);
-	autoload(PACKAGE_EXT, "make-gate", "Gate", true);
         autoload(PACKAGE_EXT, "mailbox-empty-p", "Mailbox", true);
         autoload(PACKAGE_EXT, "mailbox-peek", "Mailbox", true);
         autoload(PACKAGE_EXT, "mailbox-read", "Mailbox", true);
         autoload(PACKAGE_EXT, "mailbox-send", "Mailbox", true);
         autoload(PACKAGE_EXT, "make-mailbox", "Mailbox", true);
-        autoload(PACKAGE_EXT, "make-mutex", "Mutex", true);
         autoload(PACKAGE_EXT, "make-slime-input-stream", "SlimeInputStream", true);
         autoload(PACKAGE_EXT, "make-slime-output-stream", "SlimeOutputStream", true);
-        autoload(PACKAGE_EXT, "make-thread-lock", "ThreadLock", true);
-        autoload(PACKAGE_EXT, "open-gate", "Gate", true);
-        autoload(PACKAGE_EXT, "open-gate-p", "Gate", true);
         autoload(PACKAGE_EXT, "probe-directory", "probe_file", true);
-        autoload(PACKAGE_EXT, "release-mutex", "Mutex", true);
         autoload(PACKAGE_EXT, "set-floating-point-modes", "FloatFunctions", true);
         autoload(PACKAGE_EXT, "simple-string-fill", "StringFunctions");
         autoload(PACKAGE_EXT, "simple-string-search", "StringFunctions");
         autoload(PACKAGE_EXT, "string-input-stream-current", "StringInputStream", true);
         autoload(PACKAGE_EXT, "string-find", "StringFunctions");
         autoload(PACKAGE_EXT, "string-position", "StringFunctions");
-        autoload(PACKAGE_EXT, "thread-lock", "ThreadLock", true);
-        autoload(PACKAGE_EXT, "thread-unlock", "ThreadLock", true);
-        autoload(PACKAGE_EXT, "wait-open-gate", "Gate", true);
         autoload(PACKAGE_JAVA, "%jnew-proxy", "JProxy");
         autoload(PACKAGE_JAVA, "%find-java-class", "JavaClass");
         autoload(PACKAGE_JAVA, "%jmake-invocation-handler", "JProxy");
@@ -681,6 +670,13 @@
         autoload(PACKAGE_SYS, "std-allocate-instance", "StandardObjectFunctions", true);
         autoload(PACKAGE_SYS, "zip", "zip", true);
 
+        autoload(PACKAGE_THREADS, "make-mutex", "Mutex", true);
+        autoload(PACKAGE_THREADS, "get-mutex", "Mutex", true);
+        autoload(PACKAGE_THREADS, "release-mutex", "Mutex", true);
+        autoload(PACKAGE_THREADS, "make-thread-lock", "ThreadLock", true);
+        autoload(PACKAGE_THREADS, "thread-lock", "ThreadLock", true);
+        autoload(PACKAGE_THREADS, "thread-unlock", "ThreadLock", true);
+
         autoload(Symbol.COPY_LIST, "copy_list");
 
         autoload(Symbol.SET_CHAR, "StringFunctions");

Modified: trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	Tue Jul 21 05:43:29 2009
@@ -111,7 +111,6 @@
   public static final BuiltInClass MAILBOX              = addClass(Symbol.MAILBOX);
   public static final BuiltInClass METHOD_COMBINATION   = addClass(Symbol.METHOD_COMBINATION);
   public static final BuiltInClass MUTEX                = addClass(Symbol.MUTEX);
-  public static final BuiltInClass GATE                 = addClass(Symbol.GATE);
   public static final BuiltInClass NIL_VECTOR           = addClass(Symbol.NIL_VECTOR);
   public static final BuiltInClass NULL                 = addClass(Symbol.NULL);
   public static final BuiltInClass NUMBER               = addClass(Symbol.NUMBER);

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Tue Jul 21 05:43:29 2009
@@ -118,6 +118,7 @@
         PACKAGE_LISP.usePackage(PACKAGE_CL);
         PACKAGE_LISP.usePackage(PACKAGE_EXT);
         PACKAGE_LISP.usePackage(PACKAGE_SYS);
+	PACKAGE_THREADS.usePackage(PACKAGE_CL);
       }
     catch (Throwable t)
       {

Modified: trunk/abcl/src/org/armedbear/lisp/Mutex.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Mutex.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Mutex.java	Tue Jul 21 05:43:29 2009
@@ -101,6 +101,17 @@
         return unreadableString("MUTEX");
     }
 
+    static {
+      //FIXME: this block has been added for pre-0.16 compatibility
+      // and can be removed the latest at release 0.22
+      try {
+	PACKAGE_EXT.export(Symbol.intern("WITH-MUTEX", PACKAGE_THREADS));
+	PACKAGE_EXT.export(Symbol.intern("WITH-THREAD-LOCK", PACKAGE_THREADS));
+      } catch (ConditionThrowable t) {
+	Debug.bug();
+      }
+    }
+      
     // ### make-mutex => mutex
     private static final Primitive MAKE_MUTEX =
         new Primitive("make-mutex", PACKAGE_EXT, true, "")

Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java	Tue Jul 21 05:43:29 2009
@@ -2891,8 +2891,6 @@
     PACKAGE_EXT.addExternalSymbol("COMPILER-UNSUPPORTED-FEATURE-ERROR");
   public static final Symbol MUTEX =
     PACKAGE_EXT.addExternalSymbol("MUTEX");
-  public static final Symbol GATE =
-    PACKAGE_EXT.addExternalSymbol("GATE");
   public static final Symbol THREAD =
     PACKAGE_EXT.addExternalSymbol("THREAD");
   public static final Symbol SUPPRESS_COMPILER_WARNINGS =

Modified: trunk/abcl/src/org/armedbear/lisp/ThreadLock.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ThreadLock.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/ThreadLock.java	Tue Jul 21 05:43:29 2009
@@ -72,7 +72,7 @@
 
     // ### make-thread-lock
     private static final Primitive MAKE_THREAD_LOCK =
-        new Primitive("make-thread-lock", PACKAGE_EXT, true)
+        new Primitive("make-thread-lock", PACKAGE_THREADS, true)
     {
         @Override
         public LispObject execute() throws ConditionThrowable
@@ -83,7 +83,7 @@
 
     // ### thread-lock lock
     private static final Primitive THREAD_LOCK =
-        new Primitive("thread-lock", PACKAGE_EXT, true)
+        new Primitive("thread-lock", PACKAGE_THREADS, true)
     {
         @Override
         public LispObject execute(LispObject arg) throws ConditionThrowable
@@ -96,7 +96,7 @@
 
     // ### thread-unlock lock
     private static final Primitive THREAD_UNLOCK =
-        new Primitive("thread-unlock", PACKAGE_EXT, true)
+        new Primitive("thread-unlock", PACKAGE_THREADS, true)
     {
         @Override
         public LispObject execute(LispObject arg) throws ConditionThrowable
@@ -106,4 +106,16 @@
             return NIL;
         }
     };
+
+    static {
+      //FIXME: this block has been added for pre-0.16 compatibility
+      // and can be removed the latest at release 0.22
+      try {
+	PACKAGE_EXT.export(Symbol.intern("MAKE-THREAD-LOCK", PACKAGE_THREADS));
+	PACKAGE_EXT.export(Symbol.intern("THREAD-LOCK", PACKAGE_THREADS));
+	PACKAGE_EXT.export(Symbol.intern("THREAD-UNLOCK", PACKAGE_THREADS));
+      } catch (ConditionThrowable t) {
+	Debug.bug();
+      }
+    }
 }

Modified: trunk/abcl/src/org/armedbear/lisp/autoloads.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/autoloads.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/autoloads.lisp	Tue Jul 21 05:43:29 2009
@@ -293,15 +293,11 @@
 
 (export '(grovel-java-definitions compile-system))
 (autoload '(grovel-java-definitions compile-system) "compile-system")
-(export 'with-thread-lock)
-(autoload-macro 'with-thread-lock)
 (export 'aver)
 (autoload-macro 'aver)
 (autoload 'sys::%failed-aver "aver")
 (export 'collect)
 (autoload-macro 'collect)
-(export 'with-mutex)
-(autoload-macro 'with-mutex)
 (export 'compile-file-if-needed)
 (autoload 'compile-file-if-needed "compile-file")
 (export 'describe-compiler-policy)
@@ -315,7 +311,6 @@
 (export 'make-dialog-prompt-stream)
 (autoload 'make-dialog-prompt-stream "gui")
 
-
 ;; JVM compiler.
 (in-package "JVM")
 (export '(jvm-compile-package))
@@ -324,3 +319,9 @@
 (in-package "LISP")
 (export 'compiler-let)
 (autoload 'compiler-let)
+
+(in-package "THREADS")
+(export 'with-thread-lock)
+(ext:autoload-macro 'with-thread-lock)
+(export 'with-mutex)
+(ext:autoload-macro 'with-mutex)

Modified: trunk/abcl/src/org/armedbear/lisp/with-mutex.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/with-mutex.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/with-mutex.lisp	Tue Jul 21 05:43:29 2009
@@ -29,7 +29,7 @@
 ;;; obligated to do so.  If you do not wish to do so, delete this
 ;;; exception statement from your version.
 
-(in-package #:extensions)
+(in-package #:threads)
 
 (defmacro with-mutex ((mutex) &body body)
   (let ((m (gensym)))

Modified: trunk/abcl/src/org/armedbear/lisp/with-thread-lock.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/with-thread-lock.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/with-thread-lock.lisp	Tue Jul 21 05:43:29 2009
@@ -29,7 +29,7 @@
 ;;; obligated to do so.  If you do not wish to do so, delete this
 ;;; exception statement from your version.
 
-(in-package "EXTENSIONS")
+(in-package #:threads)
 
 (defmacro with-thread-lock ((lock) &body body)
   (let ((glock (gensym)))




More information about the armedbear-cvs mailing list