[Title] enhance synchronization of skin socket commnuication
authorSon Hyunjun <hj79.son@samsung.com>
Thu, 19 Apr 2012 03:19:01 +0000 (12:19 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Thu, 19 Apr 2012 03:19:01 +0000 (12:19 +0900)
[Type] Enhancement
[Module] Skin
[Priority] Minor
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution] timed wait for polling send queue

Change-Id: I58e23633ab9758a23d2533a34bb5c4c1605399f4

tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java

index 9f9c95d31d0446b7e7150489e3a97a7b34ae820b..3d5658b10c9e0488fa1c5976c0c2c7c2dd11208d 100644 (file)
@@ -86,6 +86,8 @@ public class SocketCommunicator implements ICommunicator {
        public static final int HEART_BEAT_INTERVAL = 1; //second
        public static final int HEART_BEAT_EXPIRE = 5;
 
+       public final static int SEND_QUEUE_WAIT_INTERVAL = 10; // milli-seconds
+       
        public final static int SCREENSHOT_WAIT_INTERVAL = 3; // milli-seconds
        public final static int SCREENSHOT_WAIT_LIMIT = 3000; // milli-seconds
        public final static int DETAIL_INFO_WAIT_INTERVAL = 1; // milli-seconds
@@ -162,7 +164,7 @@ public class SocketCommunicator implements ICommunicator {
 
                                                synchronized ( sendThread ) {
                                                        try {
-                                                               sendThread.wait();
+                                                               sendThread.wait( SEND_QUEUE_WAIT_INTERVAL );
                                                        } catch ( InterruptedException e ) {
                                                                logger.log( Level.SEVERE, e.getMessage(), e );
                                                        }