spall
2017-5-10 17:24:52
   (define cpt2 (thread (lambda () (channel-put ch 'd))))
   (printf "thread? ~a\n" (thread? cpt1))
   (thread-send cpt1 5 #f)```

```thread? #t
thread-send: contract violation
  expected: thread?
  given: #0=(thread #1=(thread (thread #f #1# ...) #0# ...) (thread #0# #f ...) ...)

(define (thread-send thd v [fail-thunk (lambda () (raise-mismatch-error 'thread-send "Thread ~a is not running.\n" thd))]) (check 'thread-send thread? thd)


spall
2017-5-10 17:25:14

@mflatt do you see a reason for this contract failure?


mflatt
2017-5-10 17:43:47

Is that the right thread? in thread-send? It’s easy to accidentally use a racket/base binding when you mean to use a replacement from “thread.rkt”


spall
2017-5-10 17:53:51

@mflatt how would I tell if its the correct thread?


spall
2017-5-10 17:54:03

thread-send is just in thread.rkt


spall
2017-5-10 17:54:17

(define (thread-wait t) (check 'thread-wait thread? t) thread-wait does the same check


mflatt
2017-5-10 17:54:55

And it’s the right thread-send in the (thread-send cpt1 5 #f)? You could check with (identifier-binding thread-send)


spall
2017-5-10 17:58:32

good idea thanks


spall
2017-5-10 18:06:13

okay that fixed it thanks. needed to export function from main.rkt