lab6/src/main/java/com/mycompany/lab6/Consumer.java
/**
     * thread method used to remove characters from buffer
     * change them into large case and print them to the screen
     */
thread method used to remove characters from buffer
change them into large case and print them to the screen
thread method used to remove characters from buffer change them into large case and print them to the screen
@Override
    public void run() {
        try {
            char event;
            for (int i = 0; i < Main.bufferSize; i++) {
                items.acquire();
                mutex.acquire();
                event = buffer.remove();
                mutex.release();
                spaces.release();
                System.out.println(Character.toUpperCase(event));
            }
        } catch (Exception e) {
            System.out.println(e.getLocalizedMessage());
        }
    }
@ Override public void run ( ) { try { char event ; for ( int i = 0 ; i < Main . bufferSize ; i ++ ) { items . acquire ( ) ; mutex . acquire ( ) ; event = buffer . remove ( ) ; mutex . release ( ) ; spaces . release ( ) ; System . out . println ( Character . toUpperCase ( event ) ) ; } } catch ( Exception e ) { System . out . println ( e . getLocalizedMessage ( ) ) ; } }
thread method used to remove characters from buffer
 change them into large case and print them to the screen
thread method used to remove characters from buffer change them into large case and print them to the screen