private void enterAtomic(){
  manageCallStackSize.incrementAndGet();
}

private void enterAtomic ( ) { manageCallStackSize . incrementAndGet ( ) ; }
it ' s tricky with this implementation because we can ' t rely on any state in between two calls to setcharacter since the caller might modify the terminal ' s state outside of this writer . however , many calls inside textgraphics will indeed make multiple calls in setcharacter where we know that the state won ' t change ( actually , we can ' t be 100 % sure since the caller might create a separate thread and maliciously write directly to the terminal while call one of the draw / fill / put methods in here ) . we could just set the state before writing every single character but that would be inefficient . rather , we keep a counter of if we are inside an ' atomic ' ( meaning we know multiple calls to setcharacter will have the same state ) . some drawing methods call other drawing methods internally for their implementation so that ' s why this is implemented with an integer value instead of a boolean ; when the counter reaches zero we remove the memory of what state the terminal is in .
