Add comments about thread safety.
This commit is contained in:
		
							parent
							
								
									f2872877ad
								
							
						
					
					
						commit
						e32b78badb
					
				| 
						 | 
					@ -13,6 +13,10 @@
 | 
				
			||||||
;; sets the value (an option record, see end of file)
 | 
					;; sets the value (an option record, see end of file)
 | 
				
			||||||
(define *options* (make-preserved-thread-fluid #f))
 | 
					(define *options* (make-preserved-thread-fluid #f))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;; TABLES are thread safe as they all use the same lock and different
 | 
				
			||||||
 | 
					;;; keys for the hash (There may be performance reasons to change
 | 
				
			||||||
 | 
					;;; this, though).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;; SURFLET-TABLE cache
 | 
					;;; SURFLET-TABLE cache
 | 
				
			||||||
(define *surflet-table* (make-string-table)) ; path-string is index
 | 
					(define *surflet-table* (make-string-table)) ; path-string is index
 | 
				
			||||||
(define *surflet-table-lock* (make-lock))
 | 
					(define *surflet-table-lock* (make-lock))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,8 +35,9 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Bindings of POST requests can be read only once, since they are
 | 
					;; Bindings of POST requests can be read only once, since they are
 | 
				
			||||||
;; read from an input port. So we have to cache them, for the case of
 | 
					;; read from an input port. So we have to cache them, for the case of
 | 
				
			||||||
;; a later GET-BINDINGS call on the same POST request. The request are
 | 
					;; a later GET-BINDINGS call on the same POST request. The requests
 | 
				
			||||||
;; referenced by a weak pointer.
 | 
					;; are referenced by a weak pointer. Thread-safe as all threads use
 | 
				
			||||||
 | 
					;; the same lock.
 | 
				
			||||||
(define *POST-bindings-cache* '())
 | 
					(define *POST-bindings-cache* '())
 | 
				
			||||||
(define *cache-lock* (make-lock))
 | 
					(define *cache-lock* (make-lock))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue