random click and gesture for android 7.0+!!!

This commit is contained in:
hyb1996
2017-05-16 21:40:23 +08:00
parent ec98d75d3b
commit c4ec951a10
42 changed files with 757 additions and 564 deletions

View File

@@ -0,0 +1,46 @@
package com.stardust.concurrent;
/**
* Created by Stardust on 2017/5/8.
*/
public class VolatileBox<T> {
private volatile T mValue;
public VolatileBox() {
}
public VolatileBox(T value) {
set(value);
}
public T get() {
return mValue;
}
public void set(T value) {
mValue = value;
}
public void setAndNotify(T value) {
mValue = value;
synchronized (this) {
notify();
}
}
public T blockedGet() {
synchronized (this) {
try {
this.wait();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
return mValue;
}
}