comparison src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/AtomicReservableReference.java @ 132:ba5370090393

index commit Prototype
author one
date Sun, 19 Oct 2014 09:15:38 +0900
parents 715a9fbf02fc
children ef183969bf31
comparison
equal deleted inserted replaced
131:1c3c3300716c 132:ba5370090393
44 public void set(V _value) 44 public void set(V _value)
45 { 45 {
46 reservation.set(new Reservation(_value,null,true)); 46 reservation.set(new Reservation(_value,null,true));
47 } 47 }
48 48
49 public Reservation getReservation(){
50 return reservation.get();
51 }
52
49 public V get() 53 public V get()
50 { 54 {
51 Reservation r = reservation.get(); 55 Reservation r = reservation.get();
52 return r.get(); 56 return r.get();
53 } 57 }
61 public Reservation(V _object,Reservation _expect,boolean _confirmed) 65 public Reservation(V _object,Reservation _expect,boolean _confirmed)
62 { 66 {
63 expect = _expect; 67 expect = _expect;
64 ref = new AtomicReference<V>(_object); 68 ref = new AtomicReference<V>(_object);
65 flagConfirmed = new AtomicBoolean(_confirmed); 69 flagConfirmed = new AtomicBoolean(_confirmed);
70 }
71
72 public void set(V object){
73 ref.set(object);
66 } 74 }
67 75
68 public V get() 76 public V get()
69 { 77 {
70 return ref.get(); 78 return ref.get();