18 package com.generalrobotix.ui.util;
19 import java.util.concurrent.TimeUnit;
20 import java.util.concurrent.locks.Condition;
21 import java.util.concurrent.locks.ReentrantLock;
22 import java.util.concurrent.locks.Lock;
34 public synchronized T
get(){
return value_; }
35 public synchronized void set(T
val){ value_ =
val; }
40 reentrantLock_.lock();
44 throws InterruptedException
47 reentrantLock_.lockInterruptibly();
53 return reentrantLock_.newCondition();
59 return reentrantLock_.tryLock();
63 throws InterruptedException
66 return reentrantLock_.tryLock(time,
unit);
72 reentrantLock_.unlock();
ReentrantLock reentrantLock_
#define null
our own NULL pointer
SynchronizedAccessor(T val)
boolean tryLock(long time, TimeUnit unit)