Changeset 15436
- Timestamp:
- 10/29/20 16:54:29 (3 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/LispThread.java
r14690 r15436 1138 1138 } 1139 1139 1140 @DocString(name="make-thread", args="function &key name") 1140 @DocString(name="make-thread", 1141 args="function &key name", 1142 doc="Create a thread of execution running FUNCTION possibly named NAME") 1141 1143 private static final Primitive MAKE_THREAD = 1142 1144 new Primitive("make-thread", PACKAGE_THREADS, true, "function &key name") … … 1164 1166 }; 1165 1167 1166 @DocString(name="threadp", args="object", 1167 doc="Boolean predicate testing if OBJECT is a thread.") 1168 @DocString(name="threadp", 1169 args="object", 1170 doc="Boolean predicate returning non-nil if OBJECT is a lisp thread") 1168 1171 private static final Primitive THREADP = 1169 1172 new Primitive("threadp", PACKAGE_THREADS, true) … … 1176 1179 }; 1177 1180 1178 @DocString(name="thread-alive-p", args="thread", 1179 doc="Returns T if THREAD is alive.") 1181 @DocString(name="thread-alive-p", 1182 args="thread", 1183 doc="Returns T if THREAD is alive.") 1180 1184 private static final Primitive THREAD_ALIVE_P = 1181 1182 "Boolean predicate whether THREAD is alive.")1185 new Primitive("thread-alive-p", PACKAGE_THREADS, true, "thread", 1186 "Boolean predicate whether THREAD is alive.") 1183 1187 { 1184 1188 @Override … … 1196 1200 }; 1197 1201 1198 @DocString(name="thread-name", args="thread", 1199 doc="Return the name of THREAD, if it has one.") 1202 @DocString(name="thread-name", 1203 args="thread", 1204 doc="Return the name of THREAD, if it has one.") 1200 1205 private static final Primitive THREAD_NAME = 1201 1206 new Primitive("thread-name", PACKAGE_THREADS, true) … … 1212 1217 1213 1218 private static final Primitive THREAD_JOIN = 1214 new Primitive("thread-join", PACKAGE_THREADS, true, "thread", 1215 "Waits for thread to finish.") 1219 new Primitive("thread-join", PACKAGE_THREADS, true, "thread", 1220 "Waits for THREAD to die before resuming execution\n" 1221 + "Returns the result of the joined thread as its primary value.\n" 1222 + "Returns T if the joined thread finishes normally or NIL if it was interrupted.") 1216 1223 { 1217 1224 @Override 1218 1225 public LispObject execute(LispObject arg) 1219 1226 { 1220 // join the thread, and returns it 's value. The second return1227 // join the thread, and returns its value. The second return 1221 1228 // value is T if the thread finishes normally, NIL if its 1222 1229 // interrupted. -
trunk/abcl/src/org/armedbear/lisp/aver.lisp
r14121 r15436 42 42 43 43 (defmacro aver (expr) 44 "Signal simple-error when EXPR is non-NIL." 44 45 `(unless ,expr 45 46 (%failed-aver ,(format nil "~A" expr)))) -
trunk/abcl/src/org/armedbear/lisp/threads.lisp
r14690 r15436 55 55 56 56 (defstruct mailbox 57 "A first-in-first out queue of messages" 57 58 queue) 58 59 … … 103 104 104 105 (defstruct mutex 106 "An object used as a mutex lock" 105 107 in-use) 106 108 107 109 (defun get-mutex (mutex) 108 "Acquires a lock on the `mutex'."110 "Acquires the lock associated with the MUTEX" 109 111 (synchronized-on mutex 110 112 (loop … … 114 116 115 117 (defun release-mutex (mutex) 116 "Releases a lock on the `mutex'."118 "Releases a lock associated with MUTEX" 117 119 (synchronized-on mutex 118 120 (setf (mutex-in-use mutex) NIL) … … 120 122 121 123 (defmacro with-mutex ((mutex) &body body) 122 "Acquires a lock on `mutex', executes the body 123 and releases the lock." 124 "Acquires a lock on MUTEX, executes BODY, and then releases the lock" 124 125 (let ((m (gensym))) 125 126 `(let ((,m ,mutex)) … … 136 137 137 138 (defun make-thread-lock () 138 "Returns an object to be used with the `with-thread-lock'macro."139 "Returns an object to be used with the WITH-THREAD-LOCK macro." 139 140 (gensym)) 140 141 141 142 (defmacro with-thread-lock ((lock) &body body) 142 "Acquires a lock on the `lock', executes `body' and releases the lock."143 "Acquires the LOCK, executes BODY and releases the LOCK" 143 144 (let ((glock (gensym))) 144 145 `(let ((,glock ,lock))
Note: See TracChangeset
for help on using the changeset viewer.