comparison src/alice/datasegment/LocalDataSegmentManager.java @ 16:433e601a8e28

network bug fix
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Sun, 15 Jan 2012 12:17:30 +0900
parents e3f1b21718b0
children 72dd27d952b0
comparison
equal deleted inserted replaced
15:45e98e74db96 16:433e601a8e28
10 public LocalDataSegmentManager() { 10 public LocalDataSegmentManager() {
11 new Thread(replyThread).start(); 11 new Thread(replyThread).start();
12 } 12 }
13 13
14 public DataSegmentKey getDataSegmentKey(String key) { 14 public DataSegmentKey getDataSegmentKey(String key) {
15 if (key == null) {
16 return null;
17 }
15 DataSegmentKey newDataSegmentKey = new DataSegmentKey(); 18 DataSegmentKey newDataSegmentKey = new DataSegmentKey();
16 DataSegmentKey dataSegmentKey = dataSegments.putIfAbsent(key, newDataSegmentKey); 19 DataSegmentKey dataSegmentKey = dataSegments.putIfAbsent(key, newDataSegmentKey);
17 if (dataSegmentKey == null) { 20 if (dataSegmentKey == null) {
18 newDataSegmentKey.runKeyThread(); 21 newDataSegmentKey.runKeyThread();
19 dataSegmentKey = newDataSegmentKey; 22 dataSegmentKey = newDataSegmentKey;