So I have this snippet pinched from Rosetta Code: (define-syntax-rule (define/atomic (name arg ...) body ...) (define name (let ([sema (make-semaphore 1)]) (lambda (arg ...) (dynamic-wind (lambda () (semaphore-wait sema)) (lambda () body ...) (lambda () (semaphore-post sema)))))))
But I would like to be able to ask whether I will have to wait, before I am in fact waiting (so I can print a message). I notice the fsemaphore package exports semaphore-count, but semaphore does not. Is this an oversight, or is there a better way to do this? Thanks, Craig -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.