@@ -22,13 +22,17 @@ import annotation.{experimental, compileTimeOnly, retainsCap}
22
22
* But even without capture checking, extending this trait can be useful for documenting the intended purpose
23
23
* of a class.
24
24
*
25
- * Capability has exactly two subtraits: Shared and Exclusive.
25
+ * Capability has exactly two subtraits: [[ SharedCapability Shared]] and [[ ExclusiveCapability Exclusive]] .
26
26
*/
27
27
sealed trait Capability extends Any
28
28
29
29
/** A marker trait for classifier capabilities that can appear in `.only`
30
30
* qualifiers. Capability classes directly extending `Classifier` are treated
31
- * as classifier capbilities
31
+ * as classifier capbilities.
32
+ *
33
+ * [[Classifier ]] has a formal meaning when
34
+ * [[scala.language.experimental.captureChecking Capture Checking ]]
35
+ * is turned on. It should not be used outside of capture checking.
32
36
*/
33
37
trait Classifier
34
38
@@ -37,23 +41,38 @@ trait Classifier
37
41
object cap extends Capability
38
42
39
43
/** Marker trait for capabilities that can be safely shared in a concurrent context.
44
+ *
45
+ * [[SharedCapability ]] has a formal meaning when
46
+ * [[scala.language.experimental.captureChecking Capture Checking ]]
47
+ * is turned on.
40
48
* During separation checking, shared capabilities are not taken into account.
41
49
*/
42
50
trait SharedCapability extends Capability , Classifier
43
51
44
52
@ experimental
45
53
type Shared = SharedCapability
46
54
47
- /** Marker trait for exclusive capabilities that are separation-checked
55
+ /** Marker trait for capabilities that should only be used by one concurrent process
56
+ * at a given time. For example, write-access to a shared mutable buffer.
57
+ *
58
+ * [[ExclusiveCapability ]] has a formal meaning when
59
+ * [[scala.language.experimental.captureChecking Capture Checking ]]
60
+ * is turned on.
61
+ * During separation checking, exclusive usage of marked capabilities will be enforced.
48
62
*/
49
63
@ experimental
50
64
trait ExclusiveCapability extends Capability , Classifier
51
65
52
66
@ experimental
53
67
type Exclusive = ExclusiveCapability
54
68
55
- /** Base trait for capabilities that capture some continuation or return point in
56
- * the stack. Examples are exceptions, labels, Async, CanThrow.
69
+ /** Marker trait for capabilities that capture some continuation or return point in
70
+ * the stack. Examples are exceptions, [[scala.util.boundary.Label labels ]], [[scala.CanThrow CanThrow ]]
71
+ * or Async contexts.
72
+ *
73
+ * [[Control ]] has a formal meaning when
74
+ * [[scala.language.experimental.captureChecking Capture Checking ]]
75
+ * is turned on.
57
76
*/
58
77
trait Control extends SharedCapability , Classifier
59
78
0 commit comments