Skip to content

Commit

Permalink
Added New-BSD License (AKA 3-clause BSD) and author tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
nbronson committed Nov 26, 2010
1 parent 0a5cc37 commit 1a14de8
Show file tree
Hide file tree
Showing 65 changed files with 153 additions and 63 deletions.
24 changes: 24 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,24 @@
Copyright (c) 2009-2010 Stanford University, unless otherwise specified.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Stanford University nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion project/build/ScalaSTMProject.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2010, Stanford University, PPL */

import sbt._

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/DelayedAtomicBlock.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -7,6 +7,8 @@ package scala.concurrent.stm
* implicit conversion in the `stm` package object from any type `A` to a
* `DelayedAtomicBlock[A]`, which will kick in if there is an attempt to call
* `.orAtomic` on a value.
*
* @author Nathan Bronson
*/
class DelayedAtomicBlock[A](above: => A) {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/InTxn.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -8,5 +8,7 @@ package scala.concurrent.stm
* `InTxn` instances themselves might be reused by the STM, use
* `Txn.currentLevel` or `Txn.rootLevel` to get a `Txn.NestingLevel` if you
* need to track an individual execution attempt.
*
* @author Nathan Bronson
*/
trait InTxn extends InTxnEnd
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/InTxnEnd.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -7,6 +7,8 @@ package scala.concurrent.stm
* locate nesting levels or register additional handlers. This functionality
* is separated from that granted by `InTxn` because `Ref` operations are not
* allowed from handlers after commit has begun.
*
* @author Nathan Bronson
*/
trait InTxnEnd extends MaybeTxn {
import Txn._
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/MaybeTxn.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -11,5 +11,7 @@ object MaybeTxn {
* bind to an implicit `InTxn` if one is available, otherwise it will bind to
* the object `TxnUnkown`. A `MaybeTxn` of `TxnUnknown` should trigger a
* dynamically-scoped `InTxn` search using `Txn.current`.
*
* @author Nathan Bronson
*/
trait MaybeTxn
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/NestingLevel.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -22,6 +22,8 @@ object NestingLevel {
*
* Methods on this class may be called from any thread, and may be called
* after the corresponding execution attempt has been completed.
*
* @author Nathan Bronson
*/
trait NestingLevel {
import Txn._
Expand Down
6 changes: 5 additions & 1 deletion src/main/scala/scala/concurrent/stm/Ref.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand All @@ -7,6 +7,8 @@ import reflect.{AnyValManifest, OptManifest}

/** `object Ref` contains factory methods that allocate an STM-managed memory
* location and return a `Ref` instance that provides access to that location.
*
* @author Nathan Bronson
*/
object Ref extends RefCompanion {

Expand Down Expand Up @@ -262,6 +264,8 @@ trait RefCompanion {
*
* `Ref`'s companion object contains factory methods that create `Ref`
* instances paired with a single STM-managed memory location.
*
* @author Nathan Bronson
*/
trait Ref[A] extends Source[A] with Sink[A] {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/Sink.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down Expand Up @@ -38,6 +38,8 @@ object Sink {

/** `Sink[+A]` consists of the contra-variant write-only operations of
* `Ref[A]`.
*
* @author Nathan Bronson
*/
trait Sink[-A] {

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/Source.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/TArray.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down Expand Up @@ -54,6 +54,8 @@ object TArray {
* potentially much more space efficient. Elements can be read and written
* directly, or the `refs` method can be used to obtain transient `Ref`
* instances backed by the elements of the `TArray`.
*
* @author Nathan Bronson
*/
trait TArray[A] {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/TMap.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down Expand Up @@ -45,6 +45,8 @@ object TMap {
* they are in the map. The `TMap` implementation assumes that it can safely
* perform key equality and hash checks outside a transaction without
* affecting atomicity.
*
* @author Nathan Bronson
*/
trait TMap[A, B] {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/TSet.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down Expand Up @@ -45,6 +45,8 @@ object TSet {
* while they are in the set. The `TSet` implementation assumes that it can
* safely perform equality and hash checks outside a transaction without
* affecting atomicity.
*
* @author Nathan Bronson
*/
trait TSet[A] {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/Txn.scala
@@ -1,11 +1,13 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

/** The `Txn` object provides methods that operate on the current transaction
* context. These methods are only valid within an atomic block or a
* transaction life-cycle handler, which is checked at compile time by
* requiring that an implicit `InTxn` or `InTxnEnd` be available.
*
* @author Nathan Bronson
*/
object Txn {
import impl.STMImpl
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/TxnExecutor.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

Expand Down Expand Up @@ -27,6 +27,8 @@ object TxnExecutor {
* new executor may be used immediately, saved and used multiple times, or
* registered as the new system-wide default using
* `TxnExecutor.transformDefault`.
*
* @author Nathan Bronson
*/
trait TxnExecutor {
/** Executes `block` one or more times until an atomic execution is achieved,
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/TxnUnknown.scala
@@ -1,9 +1,11 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm

/** An object that represents the absence of a statically-bound current
* transaction.
* @see scala.concurrent.stm.MaybeTxn
*
* @author Nathan Bronson
*/
object TxnUnknown extends MaybeTxn
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm.ccstm

Expand Down Expand Up @@ -103,6 +103,8 @@ private[ccstm] object AccessHistory {
* tame the mess the read set and write buffer interfaces are separated into
* traits housed in the companion object. This doesn't actually increase
* modularity, but makes it easier to see what is going on.
*
* @author Nathan Bronson
*/
private[ccstm] abstract class AccessHistory extends AccessHistory.ReadSet with AccessHistory.WriteBuffer {

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/CCSTM.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/CCSTMRefs.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/GV6.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/Handle.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm.ccstm

Expand Down Expand Up @@ -34,6 +34,8 @@ private[ccstm] object Handle {
* invoked). Metadata is identified by `base` and `metaOffset` (the assumption
* made during blocking is that a write to a handle's `meta` may affect the
* `meta` read by any handle with the same `base` and `metaOffset`).
*
* @author Nathan Bronson
*/
private[ccstm] abstract class Handle[T] {
def meta: Long
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/InTxnImpl.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand All @@ -22,6 +22,8 @@ private[ccstm] object InTxnImpl extends ThreadLocal[InTxnImpl] {

/** In CCSTM there is one `InTxnImpl` per thread, and it is reused across all
* transactions.
*
* @author Nathan Bronson
*/
private[ccstm] class InTxnImpl extends AccessHistory with skel.AbstractInTxn {
import CCSTM._
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/NonTxn.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand All @@ -8,6 +8,8 @@ import annotation.tailrec

/** The object that contains the code for non-transactional read and write
* barriers.
*
* @author Nathan Bronson
*/
private[ccstm] object NonTxn {
import CCSTM._
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/ReadSet.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm.ccstm

Expand Down
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm.ccstm

Expand All @@ -7,6 +7,8 @@ import annotation.tailrec

/** This is basically a specialized builder for a map from `Handle` to
* `Version`.
*
* @author Nathan Bronson
*/
private[ccstm] final class ReadSetBuilder {
private var _size = 0
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/RefOps.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/TArrayImpl.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/TxnLevelImpl.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand All @@ -15,6 +15,8 @@ private[ccstm] object TxnLevelImpl {
* and `AbstractNestingLevel`, and adds handling of the nesting level status.
* Some of the internal states (see `state`) are not instances of
* `Txn.Status`, but rather record that this level is no longer current.
*
* @author Nathan Bronson
*/
private[ccstm] class TxnLevelImpl(val txn: InTxnImpl, val par: TxnLevelImpl)
extends AccessHistory.UndoLog with skel.AbstractNestingLevel {
Expand Down
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand All @@ -10,6 +10,8 @@ import java.util.concurrent.atomic.AtomicReferenceArray
/** This class manages a mapping from active transaction to a bounded integral
* range, so that transaction identities to be packed into some of the bits of
* an integral value.
*
* @author Nathan Bronson
*/
private[ccstm] final class TxnSlotManager[T <: AnyRef](range: Int, reservedSlots: Int) {

Expand Down
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm.ccstm

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scala/concurrent/stm/ccstm/ViewOps.scala
@@ -1,4 +1,4 @@
/* scala-stm - (c) 2010, LAMP/EPFL */
/* scala-stm - (c) 2009-2010, Stanford University, PPL */

package scala.concurrent.stm
package ccstm
Expand Down

0 comments on commit 1a14de8

Please sign in to comment.