Update producer consumer problem usin threads