/* * Copyright 2007-2012 Amazon Technologies, Inc. or its affiliates. * Amazon, Amazon.com and Carbonado are trademarks or registered trademarks * of Amazon Technologies, Inc. or its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.amazon.carbonado.repo.map; import java.util.*; import java.util.concurrent.locks.*; /** * * * @author Brian S O'Neill */ @org.junit.Ignore public class TestRWLockStress { static long cSharedValue; static volatile boolean cStop; /** * @param args args[0]: readers, args[1]: upgraders, args[2]: writers, args[3]: run time */ public static void main(String[] args) throws Exception { final int readers = Integer.parseInt(args[0]); final int writers = Integer.parseInt(args[2]); final int runTimeSeconds = Integer.parseInt(args[3]); final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(args[1].equals("f")); List threads = new ArrayList(); for (int i=0; i