harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r817169 - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
Date Mon, 21 Sep 2009 06:08:41 GMT
Author: regisxu
Date: Mon Sep 21 06:08:36 2009
New Revision: 817169

URL: http://svn.apache.org/viewvc?rev=817169&view=rev
Log:
Apply patch for HARMONY-6312: Concurrency problems in NIO

synchronized on unmodifiableKeys instead of keysSet

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java?rev=817169&r1=817168&r2=817169&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
Mon Sep 21 06:08:36 2009
@@ -140,7 +140,7 @@
     protected void implCloseSelector() throws IOException {
         wakeup();
         synchronized (this) {
-            synchronized (keysSet) {
+            synchronized (unmodifiableKeys) {
                 synchronized (selectedKeys) {
                     doCancel();
                     for (SelectionKey sk : keys) {
@@ -369,7 +369,7 @@
     void modKey(SelectionKey sk) {
         // TODO: update indexes rather than recreate the key
         synchronized (this) {
-            synchronized (keysSet) {
+            synchronized (unmodifiableKeys) {
                 synchronized (selectedKeys) {
                     delKey(sk);
                     int newIndex = addKey(sk);
@@ -390,7 +390,7 @@
             throw new IllegalSelectorException();
         }
         synchronized (this) {
-            synchronized (keysSet) {
+            synchronized (unmodifiableKeys) {
 
                 // create the key
                 SelectionKey sk = new SelectionKeyImpl(channel, operations,
@@ -464,7 +464,7 @@
     private int selectInternal(long timeout) throws IOException {
         closeCheck();
         synchronized (this) {
-            synchronized (keysSet) {
+            synchronized (unmodifiableKeys) {
                 synchronized (selectedKeys) {
                     doCancel();
                     int[] readyChannels = null;



Mime
View raw message