From owner-freebsd-usb@FreeBSD.ORG Wed Feb 10 09:31:50 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3328106566C for ; Wed, 10 Feb 2010 09:31:50 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 38C5E8FC12 for ; Wed, 10 Feb 2010 09:31:49 +0000 (UTC) Received: from inchoate.gsoft.com.au (ppp121-45-157-74.lns6.adl6.internode.on.net [121.45.157.74]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id o1A9VeQB020082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 10 Feb 2010 20:01:41 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: Hans Petter Selasky Date: Wed, 10 Feb 2010 20:01:28 +1030 User-Agent: KMail/1.9.10 References: <201002101738.30753.doconnor@gsoft.com.au> <201002100923.20377.hselasky@c2i.net> In-Reply-To: <201002100923.20377.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4506954.qxt5DIKHBA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201002102001.37306.doconnor@gsoft.com.au> X-Spam-Score: -1.731 () AWL,BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: freebsd-usb@freebsd.org Subject: Re: usb_interrupt_read blocks "forever" sometimes X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Feb 2010 09:31:50 -0000 --nextPart4506954.qxt5DIKHBA Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, 10 Feb 2010, Hans Petter Selasky wrote: > I would not recommend using signals with libusb. It is not portable. > Currently signals are ignored. What you would have to do, is to use OK. > the timeout argument which you are doing, and have a timekeeper > variable somewhere, or create another thread. Still, when using the > timeout there is a chance you can loose data. The problem is that the timeout seems to be ignored sometimes - that is=20 the only reason I was playing with alarm() at all. I have the timeout set to 100 (milliseconds?) yet I find if I restart=20 the program every now and then it will get stuck on the first read. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart4506954.qxt5DIKHBA Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iD8DBQBLcnz55ZPcIHs/zowRAi7HAJ9cWCUiD9XsV9jruMxqTir8Z9+OBgCfe/up vcT/PskCJD/Hl6abDjet1Ng= =6olO -----END PGP SIGNATURE----- --nextPart4506954.qxt5DIKHBA--