c - Producer/Consumer using TCP client/server -
the server intended multithreaded server spawns new threads upon either producer or consumer connection via tcp. problem i'm getting stuck in wait state once producer client fills queue. snippet shows server's handling of producer connection. format of request producer sends put (item) reqline[0] = strtok (mesg, " \t\n"); if ( strncmp(reqline[0], "put\0", 4)==0 ) { item[0]=strtok(null," \t\n"); pthread_create (&pro, null, producer, fifo); pthread_join (pro, null); } so can see i'm creating new thread handles job of filling queue/detecting when empty. code within producer: queue *fifo; int i=atoi(item[0]); char*fullmsg="full\n"; fifo = (queue *)q; pthread_mutex_lock (fifo->mut); while (fifo->full) { //the problem block printf ("producer: queue full.\n"); send(conn_s, fullmsg,st