Coverage report: /home/ellis/.stash/quicklisp/dists/ultralisp/software/sionescu-bordeaux-threads-20250412101706/apiv2/bordeaux-threads.lisp
Kind | Covered | All | % |
expression | 4 | 75 | 5.3 |
branch | 1 | 12 | 8.3 |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;;; -*- Mode: LISP; Syntax: ANSI-Common-lisp; Base: 10; Package: BORDEAUX-THREADS-2 -*-
2
;;;; The above modeline is required for Genera. Do not change.
4
(in-package :bordeaux-threads-2)
6
(defconstant +supports-threads-p+
9
"This should be set to T if the running instance has thread support.")
12
(eval-when (:compile-toplevel :load-toplevel :execute)
13
(pushnew :bordeaux-threads *features*))
15
(defun bool (thing) (if thing t nil))
17
(define-condition bordeaux-threads-error (error) ())
19
(define-condition abnormal-exit (bordeaux-threads-error)
20
((exit-condition :initarg :condition
21
:reader abnormal-exit-condition))
22
(:report (lambda (condition stream)
23
(format stream "Thread exited with condition: ~A"
24
(abnormal-exit-condition condition)))))
26
(define-condition bordeaux-threads-simple-error
27
(simple-error bordeaux-threads-error)
30
(defun bt-error (msg &rest args)
31
(error 'bordeaux-threads-simple-error
33
:format-arguments args))
35
(define-condition not-implemented (bordeaux-threads-error)
38
(define-condition operation-not-implemented (not-implemented)
39
((operation :initarg :operation :reader operation-not-implemented-operation))
40
(:report (lambda (condition stream)
41
(format stream "Operation not implemented: ~A"
42
(operation-not-implemented-operation condition)))))
44
(define-condition keyarg-not-implemented (not-implemented)
45
((operation :initarg :operation :reader keyarg-not-implemented-operation)
46
(keyarg :initarg :keyarg :reader keyarg-not-implemented-keyarg))
47
(:report (lambda (condition stream)
48
(format stream "~A does not implement argument ~S"
49
(keyarg-not-implemented-operation condition)
50
(keyarg-not-implemented-keyarg condition)))))
52
(defun signal-not-implemented (op &optional keyarg)
54
(error 'keyarg-not-implemented :operation op :keyarg keyarg)
55
(error 'operation-not-implemented :operation op)))
57
(defparameter *missing-functions*
58
(make-hash-table :test #'eql))
60
(defparameter *missing-features*
61
(make-hash-table :test #'equal))
63
(defun mark-not-implemented (op &rest features)
65
(setf (gethash op *missing-functions*) t)
67
(setf (gethash (cons op f) *missing-features*) t))))
69
(defun implemented-p (op &optional feature)
72
(not (gethash op *missing-functions*)))
73
((gethash op *missing-functions*)
76
(not (gethash (cons op feature) *missing-features*)))))
78
(defun implemented-p* (op &optional feature)
79
(if (implemented-p op feature)
84
(define-condition timeout (serious-condition)
85
((length :initform nil
87
:reader timeout-length))
88
(:report (lambda (c s)
89
(if (timeout-length c)
90
(format s "A timeout set to ~A seconds occurred."
92
(format s "A timeout occurred.")))))