Skip to content

Commit

Permalink
Fix a very old race condition in this test.
Browse files Browse the repository at this point in the history
Probably exposed by the rktio changes.
  • Loading branch information
samth committed Jun 26, 2017
1 parent 76711df commit f9a3953
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
(define n 10)

(define (server)
(define l (tcp-listen PORT 5 #t))
(thread client)
(let-values ([(in out) (tcp-accept (tcp-listen PORT 5 #t))]
(let-values ([(in out) (tcp-accept l)]
[(buffer) (make-string (string-length DATA))])
(file-stream-buffer-mode out 'none)
(let loop ([i (read-string! buffer in)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

(: server ( -> Void))
(define (server)
(define l (tcp-listen PORT 5 #t))
(thread client)
(let-values ([(in out) (tcp-accept (tcp-listen PORT 5 #t))]
(let-values ([(in out) (tcp-accept l)]
[(buffer) (make-string (string-length DATA))])
(file-stream-buffer-mode out 'none)
(let: loop : Void ([i : (U Integer EOF) (read-string! buffer in)]
Expand Down

0 comments on commit f9a3953

Please sign in to comment.