(defun sigint-%break (format-string &rest format-arguments)
(flet ((break-it ()
(apply #'%break 'sigint format-string format-arguments)))
- (sb!thread:interrupt-thread (sb!thread::foreground-thread) #'break-it)))
+ (let ((done-p nil))
+ (loop while (not done-p)
+ do
+ (setq done-p t)
+ ;; what if I type interrupt-thread at the debugger?
+ (handler-case
+ (sb!thread:interrupt-thread (sb!thread::foreground-thread)
+ #'break-it)
+ (sb!thread:interrupt-thread-error ()
+ (setq done-p nil)))))))
(eval-when (:compile-toplevel :execute)
(sb!xc:defmacro define-signal-handler (name
(handle-thread-exit thread)))))))
(values))))
(let ((os-thread
- ;; don't let the child inherit *CURRENT-THREAD* because that
- ;; can prevent gc'ing this thread while the child runs
- (let ((*current-thread* nil))
- (with-pinned-objects (initial-function)
- (%create-thread
- (sb!kernel:get-lisp-obj-address initial-function))))))
+ (with-pinned-objects (initial-function)
+ (%create-thread
+ (sb!kernel:get-lisp-obj-address initial-function)))))
(when (zerop os-thread)
(error "Can't create a new thread"))
(wait-on-semaphore setup-sem)
#define for_each_thread(th) for(th=all_threads;th;th=0)
#endif
-static inline lispobj SymbolValue(u64 tagged_symbol_pointer, void *thread) {
+static inline lispobj
+SymbolValue(u64 tagged_symbol_pointer, void *thread) {
struct symbol *sym= (struct symbol *)
(pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG);
#ifdef LISP_FEATURE_SB_THREAD
#endif
return sym->value;
}
-static inline lispobj SymbolTlValue(u64 tagged_symbol_pointer, void *thread) {
+
+static inline lispobj
+SymbolTlValue(u64 tagged_symbol_pointer, void *thread) {
struct symbol *sym= (struct symbol *)
(pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG);
#ifdef LISP_FEATURE_SB_THREAD
#endif
}
-static inline void SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) {
+static inline void
+SetSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) {
struct symbol *sym= (struct symbol *)
(pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG);
#ifdef LISP_FEATURE_SB_THREAD
#endif
sym->value = val;
}
-static inline void SetTlSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) {
+static inline void
+SetTlSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread) {
#ifdef LISP_FEATURE_SB_THREAD
struct symbol *sym= (struct symbol *)
(pointer_sized_uint_t)(tagged_symbol_pointer-OTHER_POINTER_LOWTAG);
#endif
}
-static inline os_context_t *get_interrupt_context_for_thread(struct thread *th)
+static inline
+os_context_t *get_interrupt_context_for_thread(struct thread *th)
{
return th->interrupt_contexts
[fixnum_value(SymbolValue(FREE_INTERRUPT_CONTEXT_INDEX,th)-1)];
(with-test (:name (:thread-start :dynamic-values-and-gc))
(let ((gc-thread (sb-thread:make-thread (lambda ()
- (loop (sleep (random 0.2))
+ (loop (sleep (random 0.01))
(sb-ext:gc :full t))))))
(wait-for-threads
- (loop for i below 3000
+ (loop for i below 30000000
when (zerop (mod i 30))
- do (princ ".")
+ do (princ ".") (force-output)
collect
- (let ((*x* (lambda ())))
- (declare (special *x*))
- (sb-thread:make-thread (lambda () (functionp *x*))))))
+ (let ((*a* (lambda ()))
+ (*b* (lambda ()))
+ (*c* (lambda ()))
+ (*d* (lambda ()))
+ (*e* (lambda ()))
+ (*f* (lambda ()))
+ (*g* (lambda ()))
+ (*h* (lambda ())))
+ (declare (special *a* *b* *c* *d* *e* *f* *g* *h*))
+ (sb-thread:make-thread (lambda ()
+ (functionp *a*)
+ (functionp *b*)
+ (functionp *c*)
+ (functionp *d*)
+ (functionp *e*)
+ (functionp *f*)
+ (functionp *g*)
+ (functionp *h*))))))
(sb-thread:terminate-thread gc-thread)
(terpri)))
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.5.42"
+"0.9.5.43"