documentation tweaks

This commit is contained in:
Matthew Flatt 2012-05-03 16:20:53 -06:00
parent 209d384204
commit 23d46620f2
3 changed files with 18 additions and 18 deletions

View File

@ -112,31 +112,28 @@ Returns the content of @racket[box].}
For any @racket[v], @racket[(unbox (box v))] returns @racket[v].
@defproc[(set-box! [box (and/c box? (not/c immutable?))]
@defproc[(set-box! [box (and/c box? (not/c immutable?) (not/c impersonator?))]
[v any/c]) void?]{
Sets the content of @racket[box] to @racket[v].
Sets the content of @racket[box] to @racket[v].}
@defproc[(box-cas! [loc box?] [old any/c] [new any/c]) boolean?]{
Atomically updates the contents of @racket[loc] to @racket[new], provided
that @racket[loc] currently contains a value that is @racket[eq?] to
@racket[old]. When Racket is compiled with support for @tech{futures},
this uses a hardware @emph{compare and set} operation.
@defproc[(box-cas! [box box?] [old any/c] [new any/c]) boolean?]{
Atomically updates the contents of @racket[box] to @racket[new], provided
that @racket[box] currently contains a value that is @racket[eq?] to
@racket[old], and returns @racket[#t] in that case. If @racket[box]
does not contain @racket[old], then the result is @racket[#f].
If no other @tech{threads} or @tech{futures} attempt to access
@racket[loc], this is equivalent to
@racket[box], the operation is equivalent to
@racketblock[
(and (eq? old (unbox loc)) (set-box! loc new) #t)]
Uses of @racket[box-cas!] be performed safely in parallel with other
operations. In contrast, other atomic operations are not safe to perform in
parallel, and they therefore prevent a computation from continuing in
parallel.
If @racket[loc] is a @tech{chaperone} or @tech{impersonator} of a box, the
@exnraise[exn:fail:contract].}
}
When Racket is compiled with support for @tech{futures},
@racket[box-cas!] uses a hardware @emph{compare and set} operation.
Uses of @racket[box-cas!] be performed safely in a @tech{future} (i.e.,
allowing the future thunk to continue in parallel). }
@; ----------------------------------------------------------------------
@include-section["hashes.scrbl"]

View File

@ -215,7 +215,7 @@ Unsafe versions of @racket[unbox] and @racket[set-box!], where the
@defproc[(unsafe-box*-cas! [loc box?] [old any/c] [new any/c]) boolean?]{
Unsafe version of @racket[box-cas!]. Like @racket[unsafe-set-box*!], it does
not work on impersonators.
not work on @tech{impersonators}.
}
@deftogether[(

View File

@ -1,3 +1,6 @@
Version 5.3.0.5
Added box-cas!
Version 5.3.0.4
racket/draw: added make-color, make-brush, make-pen