Created
July 11, 2013 15:25
-
-
Save jinqian/5976446 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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