git.fiddlerwoaroof.com
Browse code

smp compatibility

2010-02-05 Robert Rorschach <rfr@franz.com>

* imap.cl: backward compatibility to 7.0 - 8.2, bump minor
version number.

Robert Rorschach authored on 05/02/2010 23:14:33
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+2010-02-05  Robert Rorschach  <rfr@franz.com>
2
+
3
+	* imap.cl: backward compatibility to 7.0 - 8.2, bump minor
4
+	version number.
5
+
1 6
 2010-01-21  Robert Rorschach  <rfr@franz.com>
2 7
 
3 8
 	* imap.cl: threadsafe resource management
... ...
@@ -116,7 +116,7 @@
116 116
 
117 117
 (provide :imap)
118 118
 
119
-(defparameter *imap-version-number* '(:major 1 :minor 13)) ; major.minor
119
+(defparameter *imap-version-number* '(:major 1 :minor 14)) ; major.minor
120 120
 
121 121
 ;; todo
122 122
 ;;  have the list of tags selected done on a per connection basis to
... ...
@@ -2101,14 +2101,24 @@
2101 2101
 ;;-- reusable line buffers
2102 2102
 
2103 2103
 (defvar *line-buffers* nil)
2104
+
2105
+#+(version>= 8 1)
2104 2106
 (defvar *line-buffers-lock* (make-basic-lock :name "line-buffers"))
2105 2107
 
2108
+(defmacro with-locked-line-buffers (&rest body)
2109
+#+(version>= 8 1)
2110
+  `(with-locked-structure (*line-buffers-lock*
2111
+			   :non-smp :without-scheduling)
2112
+     ,@body)
2113
+#-(version>= 8 1)
2114
+  `(excl::without-scheduling ,@body)
2115
+  )
2116
+
2106 2117
 (defun get-line-buffer (size)
2107 2118
   ;; get a buffer of at least size bytes
2108 2119
   (setq size (min size (1- array-total-size-limit)))
2109 2120
   (let ((found 
2110
-	 (with-locked-structure (*line-buffers-lock*
2111
-				 :non-smp :without-scheduling)
2121
+	 (with-locked-line-buffers
2112 2122
 	   (dolist (buff *line-buffers*)
2113 2123
 	     (if* (>= (length buff) size)
2114 2124
 		then ;; use this one
... ...
@@ -2116,10 +2126,8 @@
2116 2126
 		     (return buff))))))
2117 2127
     (or found  (make-string size))))
2118 2128
 
2119
-
2120 2129
 (defun free-line-buffer (buff)
2121
-  (with-locked-structure (*line-buffers-lock*
2122
-			  :non-smp :without-scheduling)
2130
+  (with-locked-line-buffers
2123 2131
     (push buff *line-buffers*)))
2124 2132
 
2125 2133
 (defun init-line-buffer (new old)