Changeset 348 for Whitix/trunk/net

Show
Ignore:
Timestamp:
04/24/08 13:26:17 (7 months ago)
Author:
mwhitworth
Message:

Add waitqueue for socket send and receive.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/net/local.c

    r333 r348  
    157157        info=(struct LocalSockInfo*)MemCacheAlloc(localInfoCache); 
    158158 
     159        printf("info = %#X\n", info); 
     160 
    159161        if (!info) 
    160162                return -ENOMEM; 
     
    202204 
    203205        /* Wait for a connection. Should time out. */ 
    204         while (ListEmpty(&info->waitingSocks)) 
    205                 ThrSchedule(); 
     206        WAIT_ON(info->waitQueue, !ListEmpty(&info->waitingSocks)); 
    206207 
    207208        client=ListEntry(info->waitingSocks.next,struct Socket, next); 
     
    252253        ListAddTail(&sockBuff->next, &peer->recvPackets); 
    253254        IrqRestoreFlags(iFlags); 
     255 
    254256        WakeUp(&peerInfo->waitQueue); 
    255257 
     
    302304                { 
    303305                        if (!ListEmpty(&info->waitingSocks)) 
    304                         { 
    305306                                item->revents|=POLL_IN; 
    306                         } 
    307307                }else if (!ListEmpty(&socket->recvPackets)) 
    308308                        item->revents|=POLL_IN;