Date: Wed, 12 Sep 2007 06:52:12 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 126327 for review Message-ID: <200709120652.l8C6qCtb075165@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126327 Change 126327 by zhouzhouyi@zhouzhouyi_mactest on 2007/09/12 06:51:32 Modify the semaphore implementation of concurreny of tcp_server and tcp_client Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tcpconnect.c#2 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tcpconnect.c#2 (text+ko) ==== @@ -152,6 +152,14 @@ printf("pcap_open_live(): %s\n",errbuf); exit(1); } /*Release the semaphore to let server go*/ + for (;;) { + int i; + i = semctl(semid, 0, GETNCNT); + if (i == -1) + err(1, "semctl GETNCNT"); + if (i == 1) + break; + } s.sem_num = 0; s.sem_op = 1; s.sem_flg = SEM_UNDO; @@ -183,6 +191,14 @@ err(1, "sever: semop -1"); /*Release the semaphore to let client go */ + for (;;) { + int i; + i = semctl(semid1, 0, GETNCNT); + if (i == -1) + err(1, "semctl GETNCNT"); + if (i == 1) + break; + } s1.sem_num = 0; s1.sem_op = 1; s1.sem_flg = SEM_UNDO;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709120652.l8C6qCtb075165>