Document @Synchronized behavior on extension functions #KT-32469
This commit is contained in:
committed by
Space Team
parent
dd9ed02fbd
commit
917c8606f5
@@ -153,6 +153,9 @@ public expect annotation class Strictfp()
|
|||||||
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
|
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
|
||||||
* will be protected from concurrent execution by multiple threads by the monitor of the instance (or,
|
* will be protected from concurrent execution by multiple threads by the monitor of the instance (or,
|
||||||
* for static methods, the class) on which the method is defined.
|
* for static methods, the class) on which the method is defined.
|
||||||
|
*
|
||||||
|
* Note that for an extension function, the monitor of the facade class, where it gets compiled to a static method, is used.
|
||||||
|
* Therefore, this annotation is recommended to be applied only to member functions and properties.
|
||||||
*/
|
*/
|
||||||
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||||
@MustBeDocumented
|
@MustBeDocumented
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ public actual annotation class Strictfp
|
|||||||
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
|
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
|
||||||
* will be protected from concurrent execution by multiple threads by the monitor of the instance (or,
|
* will be protected from concurrent execution by multiple threads by the monitor of the instance (or,
|
||||||
* for static methods, the class) on which the method is defined.
|
* for static methods, the class) on which the method is defined.
|
||||||
|
*
|
||||||
|
* Note that for an extension function, the monitor of the facade class, where it gets compiled to a static method, is used.
|
||||||
|
* Therefore, this annotation is recommended to be applied only to member functions and properties.
|
||||||
|
* In other cases, use [synchronized] function and explicitly specify the lock to be used.
|
||||||
*/
|
*/
|
||||||
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||||
@Retention(AnnotationRetention.SOURCE)
|
@Retention(AnnotationRetention.SOURCE)
|
||||||
|
|||||||
Reference in New Issue
Block a user