Added guarded blocking in producer consumer problem