ADD:add synchronised statement for getting client,but couldnt differentiate exiting for notify or timeout?