| 1 |
;; |
| 2 |
;; run-once macro inserts literal mutex (and box) |
| 3 |
;; make sure it is compilable. |
| 4 |
;; |
| 5 |
|
| 6 |
(define-module literal-mutex |
| 7 |
(export foo) |
| 8 |
(use gauche.threads)) |
| 9 |
(select-module literal-mutex) |
| 10 |
|
| 11 |
(define *v* 0) |
| 12 |
|
| 13 |
(define (foo) |
| 14 |
(run-once |
| 15 |
(set! *v* (+ *v* 1)) |
| 16 |
*v*)) |