[Mono-list] Monitor.cs

yoros@wanadoo.es yoros@wanadoo.es
Sat, 4 Jan 2003 10:17:00 +0100


--PEIAKu/WMn1b1Hv9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jan 03, 2003 at 08:03:50PM -0500, Miguel de Icaza wrote:
> Hello Pedro,
>=20
> > I was looking the source of System.Threading.Monitor class and I saw a
> > few mistakes (I think that they are mistakes). I changed that file and
> > the new one is attached to this mail. Please, see it and tell me what do
> > you think about.
>=20
> Could you provide a ChangeLog for your changes?  I looked over it, and I
> noticed:
>=20
> 	* re-format changes.
>=20
> 	* This pattern:
>=20
> -			int ms=3DConvert.ToInt32(timeout.TotalMilliseconds);
> +			double ms =3D timeout.TotalMilliseconds;
>=20
> 	  But I am not sure about what this does, or why the change was needed
> =09
> 	* This other:
>=20
> -			// FIXME when I understand what a
> -			// "synchronisation domain" is and does
> -			return(false);
> +			return Wait(obj,msi,exitContext);
>=20
> 	  This seems to be the main fix in the patch, is that what you were fixi=
ng?
>=20
> 	  What was the problem that this patch fixes?

The first change is about converting timeout.TotalMilliseconds from
double to int32 without checking if that number (in the double format)
can be represented with a int32 format. I think that the best way to
have control about the exceptions thrown when the function gets a double
greather than Int32.MaxValue.

The second change does not correct the "FIXME" because that method
depends on Wait(obj,msi,exitContext)... and it is not FIXED.

I sent this file only to comment the problem and, if I'm right, show to
the mantainer of that file a little change...

See you,

    Pedro

--=20
Pedro Martinez Juli=E1
\  yoros@terra.es
)|    yoros@wanadoo.es
/        http://yoros.cjb.net
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org
GnuPG public information:  pub  1024D/74F1D3AC
Key fingerprint =3D 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC

--PEIAKu/WMn1b1Hv9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+FqaLWIvihXTx06wRAsJaAJ98/jGb3nSYyfSVLGj3IfXY3RmKhwCZAWQg
YjvPnfOt3R7K3opA1HRd8o0=
=GnRp
-----END PGP SIGNATURE-----

--PEIAKu/WMn1b1Hv9--