Changeset 15954 in project


Ignore:
Timestamp:
09/19/09 01:04:58 (10 years ago)
Author:
Kon Lovett
Message:

Rel 2.0.1 (forgot define-for-syntax import)

Location:
release/4/synch
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/synch/tags/2.0.1/synch.scm

    r13666 r15954  
    22;;;; Kon Lovett, Mar '06
    33
    4 (declare
    5   (usual-integrations)
    6   (disable-interrupts)
    7   (inline)
    8   (fixnum)
    9   (local)
    10   (no-procedure-checks) )
    11 
    12 ;;;
    13 
    14 (require-library data-structures srfi-18)
    15 
    16 ;;;
    17 
    18 (define-for-syntax (recmuxnam nam)
    19   (string->symbol (conc nam #\- 'mutex)) )
    20 
    21 ;;;
    22 
    234(module synch (;export
     5  ;;
    246  make-object/synch
    257  object?/synch
     8  ;;
    269  synch
    2710  synch-with
     
    3821  record-synch/lock
    3922  record-synch/unlock
    40   %synch-mutex*
    41   %synch-mutex-with*
     23  ;;
    4224  %synch
    4325  %synch-with
     
    5537  %record-synch/unlock)
    5638
    57 (import
    58   scheme
    59   (only chicken
    60     optional  ;due to #!optional implementation
    61     void
    62     unless
    63     warning
    64     gensym
    65     dynamic-wind)
    66   (only data-structures
    67     conc
    68     constantly)
    69   (only srfi-18
    70     thread?
    71     make-mutex
    72     mutex?
    73     mutex-specific mutex-specific-set!
    74     mutex-lock! mutex-unlock!
    75     mutex-state) )
     39  (import scheme
     40          (only chicken define-for-syntax optional
     41                        void unless warning gensym dynamic-wind)
     42          (only data-structures conc constantly)
     43          (only srfi-18 thread? make-mutex mutex? mutex-specific mutex-specific-set!
     44                        mutex-lock! mutex-unlock! mutex-state) )
     45
     46  (require-library data-structures srfi-18)
     47
     48;;;
     49
     50(define-for-syntax (recmuxnam nam)
     51  (string->symbol (conc nam #\- 'mutex)) )
    7652
    7753;;;
     
    180156             (,$mutex-specific-set! ,?mtx (,$begin ,@?body))
    181157             (,$mutex-specific ,?mtx) ) ) ) ) ) )
    182 
    183 #; ;Since not capturing anything shouldn't need to do this
    184 (define-syntax synch/lock
    185   (lambda (form r c)
    186     (##sys#check-syntax 'synch/lock form '(_ _ . _))
    187     (let (($dynamic-wind (r 'dynamic-wind))
    188           ($unless (r 'unless))
    189           ($begin (r 'begin))
    190           ($let (r 'let))
    191           ($set! (r 'set!))
    192           ($lambda (r 'lambda))
    193           ($mutex-unlock! (r 'mutex-unlock!))
    194           ($mutex-specific (r 'mutex-specific))
    195           ($mutex-lock! (r 'mutex-lock!))
    196           (mtxvar (r (gensym)))
    197           (okvar (r (gensym)))
    198           (resvar (r (gensym))))
    199       (let ((?mtx (cadr form)) (?body (cddr form)))
    200         `(,$let ((,mtxvar ,?mtx) (,okvar #f))
    201            (,$dynamic-wind
    202              (,$lambda () (,$mutex-lock! ,mtxvar))
    203              (,$lambda () (,$let ((,resvar (,$begin ,@?body))) (,$set! ,okvar #t) ,resvar))
    204              (,$lambda () (,$unless ,okvar (,$mutex-unlock! ,mtxvar))) ) ) ) ) ) )
    205158
    206159(define-syntax synch/lock
  • release/4/synch/tags/2.0.1/synch.setup

    r13566 r15954  
    55(verify-extension-name 'synch)
    66
    7 (setup-shared-extension-module (extension-name) (extension-version "2.0.0"))
     7(setup-shared-extension-module (extension-name) (extension-version "2.0.0")
     8  #:compile-options '(-fixnum-arithmetic
     9                      -optimize-level 3
     10                      -disable-interrupts))
  • release/4/synch/tags/2.0.1/tests/run.scm

    r13471 r15954  
     1(use srfi-18 synch)
    12
     3(define-record-type foo
     4  (make-foo x y mtx)
     5  foo?
     6  (x foo-x)
     7  (y foo-y)
     8  (mtx foo-mutex))
     9 
     10(define tfoo (make-foo 1 2 (make-mutex)))
     11(record/synch foo tfoo (print (foo-x tfoo) " " (foo-y tfoo)))
  • release/4/synch/trunk/synch.scm

    r13666 r15954  
    22;;;; Kon Lovett, Mar '06
    33
    4 (declare
    5   (usual-integrations)
    6   (disable-interrupts)
    7   (inline)
    8   (fixnum)
    9   (local)
    10   (no-procedure-checks) )
    11 
    12 ;;;
    13 
    14 (require-library data-structures srfi-18)
    15 
    16 ;;;
    17 
    18 (define-for-syntax (recmuxnam nam)
    19   (string->symbol (conc nam #\- 'mutex)) )
    20 
    21 ;;;
    22 
    234(module synch (;export
     5  ;;
    246  make-object/synch
    257  object?/synch
     8  ;;
    269  synch
    2710  synch-with
     
    3821  record-synch/lock
    3922  record-synch/unlock
    40   %synch-mutex*
    41   %synch-mutex-with*
     23  ;;
    4224  %synch
    4325  %synch-with
     
    5537  %record-synch/unlock)
    5638
    57 (import
    58   scheme
    59   (only chicken
    60     optional  ;due to #!optional implementation
    61     void
    62     unless
    63     warning
    64     gensym
    65     dynamic-wind)
    66   (only data-structures
    67     conc
    68     constantly)
    69   (only srfi-18
    70     thread?
    71     make-mutex
    72     mutex?
    73     mutex-specific mutex-specific-set!
    74     mutex-lock! mutex-unlock!
    75     mutex-state) )
     39  (import scheme
     40          (only chicken define-for-syntax optional
     41                        void unless warning gensym dynamic-wind)
     42          (only data-structures conc constantly)
     43          (only srfi-18 thread? make-mutex mutex? mutex-specific mutex-specific-set!
     44                        mutex-lock! mutex-unlock! mutex-state) )
     45
     46  (require-library data-structures srfi-18)
     47
     48;;;
     49
     50(define-for-syntax (recmuxnam nam)
     51  (string->symbol (conc nam #\- 'mutex)) )
    7652
    7753;;;
     
    180156             (,$mutex-specific-set! ,?mtx (,$begin ,@?body))
    181157             (,$mutex-specific ,?mtx) ) ) ) ) ) )
    182 
    183 #; ;Since not capturing anything shouldn't need to do this
    184 (define-syntax synch/lock
    185   (lambda (form r c)
    186     (##sys#check-syntax 'synch/lock form '(_ _ . _))
    187     (let (($dynamic-wind (r 'dynamic-wind))
    188           ($unless (r 'unless))
    189           ($begin (r 'begin))
    190           ($let (r 'let))
    191           ($set! (r 'set!))
    192           ($lambda (r 'lambda))
    193           ($mutex-unlock! (r 'mutex-unlock!))
    194           ($mutex-specific (r 'mutex-specific))
    195           ($mutex-lock! (r 'mutex-lock!))
    196           (mtxvar (r (gensym)))
    197           (okvar (r (gensym)))
    198           (resvar (r (gensym))))
    199       (let ((?mtx (cadr form)) (?body (cddr form)))
    200         `(,$let ((,mtxvar ,?mtx) (,okvar #f))
    201            (,$dynamic-wind
    202              (,$lambda () (,$mutex-lock! ,mtxvar))
    203              (,$lambda () (,$let ((,resvar (,$begin ,@?body))) (,$set! ,okvar #t) ,resvar))
    204              (,$lambda () (,$unless ,okvar (,$mutex-unlock! ,mtxvar))) ) ) ) ) ) )
    205158
    206159(define-syntax synch/lock
  • release/4/synch/trunk/synch.setup

    r13566 r15954  
    55(verify-extension-name 'synch)
    66
    7 (setup-shared-extension-module (extension-name) (extension-version "2.0.0"))
     7(setup-shared-extension-module (extension-name) (extension-version "2.0.0")
     8  #:compile-options '(-fixnum-arithmetic
     9                      -optimize-level 3
     10                      -disable-interrupts))
  • release/4/synch/trunk/tests/run.scm

    r13471 r15954  
     1(use srfi-18 synch)
    12
     3(define-record-type foo
     4  (make-foo x y mtx)
     5  foo?
     6  (x foo-x)
     7  (y foo-y)
     8  (mtx foo-mutex))
     9 
     10(define tfoo (make-foo 1 2 (make-mutex)))
     11(record/synch foo tfoo (print (foo-x tfoo) " " (foo-y tfoo)))
Note: See TracChangeset for help on using the changeset viewer.