Skip to content

Instantly share code, notes, and snippets.

@jinqian
Created July 11, 2013 15:25
Show Gist options
  • Select an option

  • Save jinqian/5976446 to your computer and use it in GitHub Desktop.

Select an option

Save jinqian/5976446 to your computer and use it in GitHub Desktop.
public void BackgroundThreadExecutionMethod() {
synchronized (mPauseWorkLock) {
while (mPauseWork) {
try {
mPauseWorkLock.wait();
} catch (InterruptedException e) {}
}
}
}
public void setPauseWork(boolean pauseWork) {
synchronized (mPauseWorkLock) {
mPauseWork = pauseWork;
if (!mPauseWork) {
mPauseWorkLock.notifyAll();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment