Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cs & io: fix log receiver synchronization
A misplaced `wrap-evt` could allow the result from `sync` on a log receiver to be an opaque event, instead of a vector. In other cases, a differently misplaced `wrap-evt` could also cause an internal instance of `control-state-evt` to not be unregistered correctly. The solution to both problems is to add a wrapper procedure to `control-state-evt`. Closes #2664
- Loading branch information
Showing
9 changed files
with
76 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#lang racket/base | ||
|
||
(define (do-thread t) (thread t)) | ||
(set! do-thread do-thread) | ||
|
||
(let loop ([i 0]) | ||
(unless (= i 2000000) | ||
(when (zero? (modulo i 10000)) | ||
(printf "~s\n" i)) | ||
(define (spin-a-while) | ||
(let loop ([j (random (add1 (modulo i 100000)))]) | ||
(unless (zero? j) | ||
(loop (sub1 j))))) | ||
(define s (make-log-receiver (current-logger) 'info 'send)) | ||
(define t | ||
(do-thread | ||
(lambda () | ||
(log-message (current-logger) 'info 'send "a" 1)))) | ||
(spin-a-while) | ||
(unless (vector? (sync s)) | ||
(error "not a vector result!")) | ||
(thread-wait t) | ||
(loop (add1 i)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters