jdk/src/share/classes/java/awt/Container.java
changeset 11094 1f244f2719d3
parent 9658 5484189eeabb
child 12643 5d709010bb1d
--- a/jdk/src/share/classes/java/awt/Container.java	Sat Nov 12 04:13:38 2011 +0400
+++ b/jdk/src/share/classes/java/awt/Container.java	Wed Nov 16 15:40:59 2011 +0400
@@ -1950,7 +1950,7 @@
      */
     public void paint(Graphics g) {
         if (isShowing()) {
-            synchronized (this) {
+            synchronized (getObjectLock()) {
                 if (printing) {
                     if (printingThreads.contains(Thread.currentThread())) {
                         return;
@@ -2004,7 +2004,7 @@
         if (isShowing()) {
             Thread t = Thread.currentThread();
             try {
-                synchronized (this) {
+                synchronized (getObjectLock()) {
                     if (printingThreads == null) {
                         printingThreads = new HashSet();
                     }
@@ -2013,7 +2013,7 @@
                 }
                 super.print(g);  // By default, Component.print() calls paint()
             } finally {
-                synchronized (this) {
+                synchronized (getObjectLock()) {
                     printingThreads.remove(t);
                     printing = !printingThreads.isEmpty();
                 }