We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a538f2b commit 6fc130dCopy full SHA for 6fc130d
http/connection.lisp
@@ -41,9 +41,11 @@
41
:initform (local-time:now)
42
:accessor connection-open-time)))
43
44
-(defvar *connection* nil)
+(let ((counter 0))
45
+ (defun next-connection-id ()
46
+ (excl:incf-atomic counter)))
47
-(defvar *global-connection-indexer* 0)
48
+(defvar *connection* nil)
49
50
;; TODO: Use weak hash table
51
(defvar *connection-table* (make-hash-table))
@@ -81,7 +83,7 @@
81
83
(error "Expect IPv4 address, got ~A" address))
82
84
(format nil "~{~A~,^.~}" (coerce address 'list))))
85
(let ((connection (make-instance 'connection
- :id (excl:incf-atomic *global-connection-indexer*)
86
+ :id (next-connection-id)
87
:listener listener
88
:socket socket
89
:input-stream stream
0 commit comments