Return the context associated with the current scope, will never return null. Will never return CancellableContext even if one is attached, instead a Context is returned with the same properties and lifetime. This is to avoid code stealing the ability to cancel arbitraril
()
| 169 | * code stealing the ability to cancel arbitrarily. |
| 170 | */ |
| 171 | public static Context current() { |
| 172 | Context current = storage().current(); |
| 173 | if (current == null) { |
| 174 | return ROOT; |
| 175 | } |
| 176 | return current; |
| 177 | } |
| 178 | |
| 179 | final CancellableContext cancellableAncestor; |
| 180 | final Node<Key<?>, Object> keyValueEntries; |