jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
author sjiang
Fri, 02 May 2014 14:40:52 +0200
changeset 24250 0e2a906a043d
parent 5506 202f599c92aa
child 28404 ca8570ff2a87
permissions -rw-r--r--
8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121 Reviewed-by: dfuchs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 6303187
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Test that no locks are held when a monitor attribute is sampled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * or notif delivered.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * @author Eamonn McManus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * @run clean CounterMonitorDeadlockTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @run build CounterMonitorDeadlockTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @run main CounterMonitorDeadlockTest 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * @run main CounterMonitorDeadlockTest 2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * @run main CounterMonitorDeadlockTest 3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @run main CounterMonitorDeadlockTest 4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.lang.management.ManagementFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.util.concurrent.atomic.AtomicInteger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import javax.management.Attribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import javax.management.JMX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import javax.management.MBeanServer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import javax.management.Notification;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import javax.management.NotificationListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import javax.management.monitor.CounterMonitor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import javax.management.monitor.CounterMonitorMBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
public class CounterMonitorDeadlockTest {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        if (args.length != 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            throw new Exception("Arg should be test number");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        int testNo = Integer.parseInt(args[0]) - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        TestCase test = testCases[testNo];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        System.out.println("Test: " + test.getDescription());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        test.run();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        System.out.println("Test passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private static enum When {IN_GET_ATTRIBUTE, IN_NOTIFY};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private static abstract class TestCase {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        TestCase(String description, When when) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            this.description = description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            this.when = when;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        void run() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            final ObjectName observedName = new ObjectName("a:b=c");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            final ObjectName monitorName = new ObjectName("a:type=Monitor");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            mbs.registerMBean(new CounterMonitor(), monitorName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            final CounterMonitorMBean monitorProxy =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                JMX.newMBeanProxy(mbs, monitorName, CounterMonitorMBean.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            final TestMBean observedProxy =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                JMX.newMBeanProxy(mbs, observedName, TestMBean.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            final Runnable sensitiveThing = new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                    doSensitiveThing(monitorProxy, observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            final Runnable nothing = new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                public void run() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            final Runnable withinGetAttribute =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                (when == When.IN_GET_ATTRIBUTE) ? sensitiveThing : nothing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            mbs.registerMBean(new Test(withinGetAttribute), observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            monitorProxy.addObservedObject(observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            monitorProxy.setObservedAttribute("Thing");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            monitorProxy.setInitThreshold(100);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            monitorProxy.setGranularityPeriod(10L); // 10 ms
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            monitorProxy.setNotify(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            monitorProxy.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            final int initGetCount = observedProxy.getGetCount();
24250
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   101
            int getCount;
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   102
            System.out.println("Checking GetCount, possible deadlock if timeout.");
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   103
            do { // 8038322. Until timeout of testing harness
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   104
                Thread.sleep(200);
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   105
            } while ((getCount=observedProxy.getGetCount()) == initGetCount);
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   106
            System.out.println("Done!");
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   107
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            if (getCount <= initGetCount)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                throw new Exception("Test failed: presumable deadlock");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            // This won't show up as a deadlock in CTRL-\ or in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            // ThreadMXBean.findDeadlockedThreads(), because they don't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            // see that thread A is waiting for thread B (B.join()), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            // thread B is waiting for a lock held by thread A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            // Now we know the monitor has observed the initial value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            // so if we want to test notify behaviour we can trigger by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            // exceeding the threshold.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            if (when == When.IN_NOTIFY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                final AtomicInteger notifCount = new AtomicInteger();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                final NotificationListener listener = new NotificationListener() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    public void handleNotification(Notification n, Object h) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                        Thread t = new Thread(sensitiveThing);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                        t.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                            t.join();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                        } catch (InterruptedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                            throw new RuntimeException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                        notifCount.incrementAndGet();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                mbs.addNotificationListener(monitorName, listener, null, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                observedProxy.setThing(1000);
24250
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   134
                System.out.println("Waiting notifCount.get() != 0, possible deadlock if timeout.");
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   135
                do {
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   136
                    Thread.sleep(200);
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   137
                } while(notifCount.get() == 0); // 8038322. Until timeout of testing harness
0e2a906a043d 8031036: com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java failed on 8b121
sjiang
parents: 5506
diff changeset
   138
                System.out.println("Done");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        abstract void doSensitiveThing(CounterMonitorMBean monitorProxy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                                       ObjectName observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        String getDescription() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            return description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        private final String description;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        private final When when;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    private static final TestCase[] testCases = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        new TestCase("Remove monitored MBean within monitored getAttribute",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                     When.IN_GET_ATTRIBUTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            void doSensitiveThing(CounterMonitorMBean monitorProxy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                                  ObjectName observedName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                monitorProxy.removeObservedObject(observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        new TestCase("Stop monitor within monitored getAttribute",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                     When.IN_GET_ATTRIBUTE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            void doSensitiveThing(CounterMonitorMBean monitorProxy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                                  ObjectName observedName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                monitorProxy.stop();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        new TestCase("Remove monitored MBean within threshold listener",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                     When.IN_NOTIFY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            void doSensitiveThing(CounterMonitorMBean monitorProxy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                  ObjectName observedName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                monitorProxy.removeObservedObject(observedName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        new TestCase("Stop monitor within threshold listener",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                     When.IN_NOTIFY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            @Override
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            void doSensitiveThing(CounterMonitorMBean monitorProxy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                                  ObjectName observedName) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                monitorProxy.stop();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        },
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    public static interface TestMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        public int getThing();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        public void setThing(int thing);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        public int getGetCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    public static class Test implements TestMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        public Test(Runnable runWithinGetAttribute) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            this.runWithinGetAttribute = runWithinGetAttribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        public int getThing() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            Thread t = new Thread(runWithinGetAttribute);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            t.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                t.join();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            } catch (InterruptedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                throw new RuntimeException(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            getCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            return thing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        public void setThing(int thing) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            this.thing = thing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        public int getGetCount() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            return getCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        private final Runnable runWithinGetAttribute;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        private volatile int getCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        private volatile int thing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
}