mark the status as closed . once the status is closed , it can not be reopened . concode_field_sep AtomicInteger status concode_elem_sep int STATUS_CLOSED_MASK concode_field_sep void reference concode_elem_sep int getReferenceCount concode_elem_sep boolean isOpen concode_elem_sep void unreferenceCheckClosed concode_elem_sep boolean unreference
int function ( ) { while ( true ) { int loc0 = status . get ( ) ; if ( ( loc0 & STATUS_CLOSED_MASK ) != 0 ) { throw new ClosedChannelException ( ) ; } if ( status . compareAndSet ( loc0 , loc0 | STATUS_CLOSED_MASK ) ) { return loc0 & ( ~ STATUS_CLOSED_MASK ) ; } } }