Code example for ConditionVariable

Methods: block, close

0
	 
	public Looper getLooper(){
		//wait for its create 
		if (null == mThreadLooper){
			LogUtils.LOGD(TAG, "wait for thread looper.");				
	        mThreadLooperAvailable.block();
	        mThreadLooperAvailable.close();
		} 
		return mThreadLooper;
	} 
		 
	@Override  
	public void run() { 
		LogUtils.LOGD(TAG, "run <----");
		Looper.prepare();		
		mThreadLooper = Looper.myLooper();	
		LogUtils.LOGD(TAG, "create amui thread looper");
		mThreadLooperAvailable.open();
		Looper.loop();
		LogUtils.LOGD(TAG, "run ---->");		
	}