Skip to content

Commit 9d92d07

Browse files
committed
---
yaml --- r: 13022 b: refs/heads/master c: 30f8555 h: refs/heads/master v: v3
1 parent 75c74c2 commit 9d92d07

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5b72e52e472ca06f42700a322dc2cac4c38e05f1
2+
refs/heads/master: 30f8555544481e998f52d196c5a0f4d04cbcf334
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libstd/arc.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#[doc = "An atomically reference counted wrapper that can be used
2-
hare immutable data between tasks."]
1+
#[doc = "An atomically reference counted wrapper that can be used to
2+
share immutable data between tasks."]
33

44
export arc, get, clone;
55

@@ -34,6 +34,7 @@ resource arc_destruct<T>(data: *arc_data<T>) {
3434

3535
type arc<T> = arc_destruct<T>;
3636

37+
#[doc="Create an atomically reference counted wrapper."]
3738
fn arc<T>(-data: T) -> arc<T> {
3839
let data = ~{mut count: 1, data: data};
3940
unsafe {
@@ -43,12 +44,19 @@ fn arc<T>(-data: T) -> arc<T> {
4344
}
4445
}
4546

47+
#[doc="Access the underlying data in an atomically reference counted
48+
wrapper."]
4649
fn get<T>(rc: &a.arc<T>) -> &a.T {
4750
unsafe {
4851
&(***rc).data
4952
}
5053
}
5154

55+
#[doc="Duplicate an atomically reference counted wrapper.
56+
57+
The resulting two `arc` objects will point to the same underlying data
58+
object. However, one of the `arc` objects can be sent to another task,
59+
allowing them to share the underlying data."]
5260
fn clone<T>(rc: &arc<T>) -> arc<T> {
5361
let data = **rc;
5462
unsafe {

0 commit comments

Comments
 (0)