Code example for Semaphore

Methods: acquireUninterruptibly

		if (DEBUG) {
			Log.d(TAG, "pre surfaceCreated()...");
		renderRunnable = new RenderRunnable();
		renderThreadStartSemaphore = new Semaphore(0);
		renderThreadDestroySemaphore = new Semaphore(0);
		surfaceReadySemaphore = new Semaphore(0);
		glInitializeSemaphore = new Semaphore(0);
		// Start thread and wait until it starts 
		new Thread(renderRunnable, "GL_Thread").start();
		if (DEBUG) {
			Log.d(TAG, "post surfaceCreated()");
	public void surfaceDestroyed(SurfaceHolder holder) {
Connect your IDE to all the code out there  Get Codota for Java