~ubuntu-branches/debian/sid/scala/sid

« back to all changes in this revision

Viewing changes to src/reflect/scala/reflect/runtime/SynchronizedOps.scala

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg, Mehdi Dogguy, Lucas Satabin, Frank S. Thomas, Emmanuel Bourg
  • Date: 2015-06-05 23:52:59 UTC
  • mfrom: (1.2.11)
  • Revision ID: package-import@ubuntu.com-20150605235259-wk00vgk83dh8o19g
Tags: 2.10.5-1
* Team upload.

[ Mehdi Dogguy ]
* New upstream release (Closes: #744278).

[ Lucas Satabin ]
* Update patches
* Update the clean target
* Update paths of elements to install
* Update watch file

[ Frank S. Thomas ]
* Remove myself from Uploaders.

[ Emmanuel Bourg ]
* The package has been adopted by the Java Team (Closes: #754935)
* Patched the build to avoid downloading libraries from the Internet
* Replaced the minified JavaScript files with unobfuscated ones
* No longer build scala-partest.jar until diffutils is packaged or replaced
* debian/watch: Fixed the versions matched (x.y.z instead of x.y.z..z)
* debian/rules:
  - Added the missing get-orig-source target (Closes: #724704)
  - Improved the clean target
* debian/control:
  - Build depend on scala (>= 2.10) and bnd
  - Use canonical URLs for the Vcs-* fields
  - Standards-Version updated to 3.9.6 (no changes)
* Switch to debhelper level 9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package scala.reflect
 
2
package runtime
 
3
 
 
4
// SI-6240: test thread-safety, make trees synchronized as well
 
5
private[reflect] trait SynchronizedOps extends internal.SymbolTable
 
6
                         with SynchronizedSymbols
 
7
                         with SynchronizedTypes { self: SymbolTable =>
 
8
 
 
9
// Names
 
10
 
 
11
  private lazy val nameLock = new Object
 
12
 
 
13
  override def newTermName(s: String): TermName = nameLock.synchronized { super.newTermName(s) }
 
14
  override def newTypeName(s: String): TypeName = nameLock.synchronized { super.newTypeName(s) }
 
15
 
 
16
// BaseTypeSeqs
 
17
 
 
18
  override protected def newBaseTypeSeq(parents: List[Type], elems: Array[Type]) =
 
19
    new BaseTypeSeq(parents, elems) with SynchronizedBaseTypeSeq
 
20
 
 
21
  trait SynchronizedBaseTypeSeq extends BaseTypeSeq {
 
22
    override def apply(i: Int): Type = synchronized { super.apply(i) }
 
23
    override def rawElem(i: Int) = synchronized { super.rawElem(i) }
 
24
    override def typeSymbol(i: Int): Symbol = synchronized { super.typeSymbol(i) }
 
25
    override def toList: List[Type] = synchronized { super.toList }
 
26
    override def copy(head: Type, offset: Int): BaseTypeSeq = synchronized { super.copy(head, offset) }
 
27
    override def map(f: Type => Type): BaseTypeSeq = synchronized { super.map(f) }
 
28
    override def exists(p: Type => Boolean): Boolean = synchronized { super.exists(p) }
 
29
    override lazy val maxDepth = synchronized { maxDepthOfElems }
 
30
    override def toString = synchronized { super.toString }
 
31
 
 
32
    override def lateMap(f: Type => Type): BaseTypeSeq = new MappedBaseTypeSeq(this, f) with SynchronizedBaseTypeSeq
 
33
  }
 
34
 
 
35
// Scopes
 
36
 
 
37
  override def newScope = new Scope() with SynchronizedScope
 
38
  override def newNestedScope(outer: Scope): Scope = new Scope(outer) with SynchronizedScope
 
39
 
 
40
  trait SynchronizedScope extends Scope {
 
41
    override def isEmpty: Boolean = synchronized { super.isEmpty }
 
42
    override def size: Int = synchronized { super.size }
 
43
    override def enter[T <: Symbol](sym: T): T = synchronized { super.enter(sym) }
 
44
    override def rehash(sym: Symbol, newname: Name) = synchronized { super.rehash(sym, newname) }
 
45
    override def unlink(e: ScopeEntry) = synchronized { super.unlink(e) }
 
46
    override def unlink(sym: Symbol) = synchronized { super.unlink(sym) }
 
47
    override def lookupAll(name: Name) = synchronized { super.lookupAll(name) }
 
48
    override def lookupEntry(name: Name) = synchronized { super.lookupEntry(name) }
 
49
    override def lookupNextEntry(entry: ScopeEntry) = synchronized { super.lookupNextEntry(entry) }
 
50
    override def toList: List[Symbol] = synchronized { super.toList }
 
51
  }
 
52
}