From: Lars Christensen Date: 2002-05-27T21:43:48+09:00 Subject: Re: SizedQueue.new(0) --XF85m9dhOBO43t/C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 27, 2002 at 09:33:45PM +0900, Michael Neumann wrote: > On Mon, May 27, 2002 at 09:12:35PM +0900, Lars Christensen wrote: > >=20 > > Is this a bug in Ruby or my brain? :-) > >=20 > > $ sizedqueue.rb=20 > > quire 'thread.rb' > > q =3D SizedQueue.new(0) > > Thread.start { q.pop } > > q.push 1=20 >=20 > Maybe it has something to do that you define an empty queue?=20 >=20 > This works: >=20 > q =3D SizedQuere.new(n) # n > 0=20 But I want an empty queue. I expected pushing the first element on a queue = with max 0 elements to block the thread, just as a pushing the 5th element on a = full queue with max 4 elements. --=20 Lars Christensen --XF85m9dhOBO43t/C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (SunOS) Comment: For info see http://www.gnupg.org iD8DBQE88ioAu9sWhhA5M0gRAg/8AKCG1joiktgcGTXBuplJlBNgr8+jFwCeJUmu 7hTSk3neb3F36uNdx9oS/U4= =tnWv -----END PGP SIGNATURE----- --XF85m9dhOBO43t/C--