qhangup()

qhangup()

概要

引数

実装

 1410: /*
 1411:  *  Mark a queue as closed.  Wakeup any readers.  Don't remove queued
 1412:  *  blocks.
 1413:  */
 1414: void
 1415: qhangup(Queue *q, char *msg)
 1416: {
 1417:         /* mark it */
 1418:         ilock(q);
 1419:         q->state |= Qclosed;
 1420:         if(msg == 0 || *msg == 0)
 1421:                 strcpy(q->err, Ehungup);
 1422:         else
 1423:                 strncpy(q->err, msg, ERRMAX-1);
 1424:         iunlock(q);
 1425: 
 1426:         /* wake up readers/writers */
 1427:         wakeup(&q->rr);
 1428:         wakeup(&q->wr);
 1429: }