FileDocCategorySizeDatePackage
Counter1.javaAPI DocExample566Sun Feb 27 14:34:06 GMT 2000tuning.threads

Counter1

public class Counter1 extends Object

Fields Summary
static long[]
vec
Constructors Summary
Methods Summary
public static voidaddAmount(int key, long amount)

    //This is not atomically synchronized since we do an array
    //access together with an update, which are two operations.
    vec[key] += amount;
  
public static longgetAmount(int key)

    return vec[key];
  
public static voidinitialize(int key)

 

      
  
    vec[key] = 0;