summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorSzabolcs Berecz <szabolcs.berecz@gmail.com>2012-01-29 01:24:28 +0100
committerSzabolcs Berecz <szabolcs.berecz@gmail.com>2012-02-16 21:36:58 +0100
commit01ee3de96dcae707fb8fee28e93af0515519c603 (patch)
treee4dcd0e7ba8ab1036abd92dbfaecc2cb9fa14175 /src/library
parentb8b19b1ca1de01083cf0975226a34424bd729a5b (diff)
downloadscala-01ee3de96dcae707fb8fee28e93af0515519c603.tar.gz
scala-01ee3de96dcae707fb8fee28e93af0515519c603.tar.bz2
scala-01ee3de96dcae707fb8fee28e93af0515519c603.zip
replace methods containing a synchronized body with synchronized methods
The following: def f = synchronized { ... } will be rewritten to: <synchronized> def f = ... which is then emitted to the classfile with the synchronized flag set. Inlining of such transformed methods are disabled for now This transformation is not done on methods defined in a trait.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/annotation/synchronized.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/library/scala/annotation/synchronized.scala b/src/library/scala/annotation/synchronized.scala
new file mode 100644
index 0000000000..9470c7173c
--- /dev/null
+++ b/src/library/scala/annotation/synchronized.scala
@@ -0,0 +1,15 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2011, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+package scala.annotation
+
+/**
+ * If this annotation is present on a method, the synchronized flag will be emitted.
+ * FIXME This should be internal to the compiler
+ */
+private[scala] class synchronized extends StaticAnnotation