Java2016. 7. 1. 22:18
class WaitingThread implements Runnable {
Thread thread;
boolean isRun = false;
boolean isWait = false;
public WaitingThread(){}

public void startThread(){
isRun = true;
isWait = false;
if(thread != null) {
     thread = new Thread(this);
thread.start();
}else {
synchronized(thread){
thread.notify();
}
}
}

public void stopThread(){
isRun = false;
if(thread != null){
synchronized(thread){
thread.interrupt();
}
thread = null;
}

}
public void setWait(){
isWait = true;
}
public void waitThread(){
if(thread != null){
synchronized(thread){
try{
thread.wait();
}catch(Exception e){}
}
}
}
public void run(){
while(isRun){
working();
if(isWait) waitThread();
}
}
public void working(){

}

}



Posted by idwook
Tool/Eclipse2015. 12. 10. 11:10

eclipse>Preference>Java>Code Style>Code Templates 


Comments

Files

/*

 * @(#)${file_name}

 * @(#)copyright : (c)${year}.idwook

 * @(#)compay : remo computing inc.

 *

 */


/**

 * 

 * <pre> </pre>

 * @author idwook

 * @version  1.01

 * @date  ${date}

 * @see  

 *

 * ${tags}

 */

Constructors

/**

 * <pre><h1>생성자</h1>

 * 설명 : 

 * </pre>

 * @method ${enclosing_type}

 * ${tags}

 */

Methods

/**

 * <pre><h1>제목</h1>

 * 설명 : 

 * </pre>

 * @method name ${enclosing_method}

 * ${tags}

 */

ALT + SHIFT + J 

'Tool > Eclipse' 카테고리의 다른 글

이클립스 연도별 버전  (0) 2018.12.28
Posted by idwook
OS/Linux2015. 12. 7. 12:58

0 : ---

1 : --x

2 : -w-

3 : -wx

4 : r--

5 : r-x

6 : rw-

7 : rwx

'OS > Linux' 카테고리의 다른 글

우분투 TFTP 설치  (0) 2017.03.03
cat 출력시 시간표현 변환  (0) 2015.12.01
MTU 설정으로 인터넷 속도 향상  (0) 2015.08.05
Qmailtoaster 설치 centos6.5  (0) 2015.07.28
Centos 언어 설정  (0) 2014.11.27
Posted by idwook