File: xref.rkt

package info (click to toggle)
racket-mode 20250711~git.8a80578-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,024 kB
  • sloc: lisp: 17,215; makefile: 106
file content (17 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
;; Copyright (c) 2013-2024 by Greg Hendershott.
;; SPDX-License-Identifier: GPL-3.0-or-later

#lang racket/base

(require setup/xref)

(provide get-xref)

;; A single xref instance for all our modules to share.
;;
;; Will block safely until ready, if used from e.g. delay/thread or
;; delay/idle (which, although we're not doing now, we've done before,
;; and might do again someday).
(define sema (make-semaphore 1))
(define xref (call-with-semaphore sema load-collections-xref))
(define (get-xref) (call-with-semaphore sema (λ () xref)))