Created
September 28, 2015 22:23
-
-
Save soegaard/48b24d807dce40a1f226 to your computer and use it in GitHub Desktop.
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
#lang racket/gui | |
(let ([new-es (make-eventspace)]) | |
(parameterize ([current-eventspace new-es]) | |
(define frame (new frame% | |
[label "Bug demo"])) | |
(define button (new button% | |
[callback | |
(lambda _ | |
(thread | |
(thunk | |
(channel-put result-chan (random)))))] | |
[label "FOOBAR"] | |
[parent frame])) | |
(define result-chan (make-channel)) | |
(define (calling-me-should-get-a-number) | |
(send frame show #t) | |
(define toret (channel-get result-chan)) | |
(send frame show #f) | |
toret) | |
(send frame show #t) ;; remove me and program doesn't start?!?! | |
(thread | |
(thunk | |
(let loop() | |
(displayln (calling-me-should-get-a-number)) | |
;(sleep 1) ;; uncomment me and program dies after one iteration?!?! | |
(loop)))))) | |
(sleep 100000000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment