FileDocCategorySizeDatePackage
Counter2.javaAPI DocExample568Sun Feb 27 14:34:28 GMT 2000tuning.threads

Counter2

public class Counter2 extends Object

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

    //Now the method is synchronized, so we will always
    //complete any particular update
    vec[key] += amount;
  
public static synchronized longgetAmount(int key)

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

 

       
  
    vec[key] = 0;