bankers, dinning philosopher, reader writer problem implementation in java