Code example for LinkedBlockingQueue

Methods: put

0
            mEventLoader = eventLoader;
        } 
 
        public void shutdown() { 
            try { 
                mQueue.put(new ShutdownRequest());
            } catch (InterruptedException ex) {
                // The put() method fails with InterruptedException if the 
                // queue is full. This should never happen because the queue 
                // has no limit. 
                Log.e("Cal", "LoaderThread.shutdown() interrupted!");
            } 
        } 
 
        @Override 
        public void run() { 
            Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
            while (true) { 
                try { 
                    // Wait for the next request 
                    LoadRequest request = mQueue.take();