[Mono-list] Console.Write does not lock the console while writting.

Dick Porter dick@ximian.com
10 Nov 2003 14:44:06 +0000


On Fri, 2003-11-07 at 18:06, Miguel de Icaza wrote:
> Hello,
> 
> > When I try the same program on mono 0.26+linux it
> > seems that the console is not locked in the callme
> > function while executing System.Console.WriteLine
> > (unlike in windows) and the behaviour is totally
> > different in the two worlds.
> 
> Have you tried a more recent Mono?  We did fix that issue a long time
> ago.

In fact, we took the locking out deliberately :)

In April, Miguel removed the locking from FileStream.cs, because that is
not declared to be thread-safe.  We had a long argument about it, and
Miguel convinced me he was right:  System.Console uses
TextWriter.Synchronized to perform the necessary locking.

If you can demonstrate differing behaviour between mono and ms, please
file a bug.

- Dick