[FIR] Add KDoc about thread safety rules of FirDeclarationAttributes
This commit is contained in:
committed by
TeamCityServer
parent
a13696072d
commit
9844671ded
+8
@@ -15,6 +15,14 @@ import kotlin.reflect.KProperty
|
||||
|
||||
abstract class FirDeclarationDataKey
|
||||
|
||||
/**
|
||||
* Please note that FirDeclarationAttributes itself is thread unsafe, so when you read
|
||||
* or write some attribute you need to ensure that this operation is safe and there
|
||||
* won't be any race condition. You can achieve this by
|
||||
* - setting attribute to declaration before it's publication (e.g. in scopes)
|
||||
* - setting attribute in one phase and reading it only in following ones (using `ensureResolve` on symbol)
|
||||
* - resetting attribute under lock over specific attribute value
|
||||
*/
|
||||
class FirDeclarationAttributes : AttributeArrayOwner<FirDeclarationDataKey, Any> {
|
||||
override val typeRegistry: TypeRegistry<FirDeclarationDataKey, Any>
|
||||
get() = FirDeclarationDataRegistry
|
||||
|
||||
Reference in New Issue
Block a user