[Mono-devel-list] [PATCH] Warn on lock (string) or lock (typeof (Foo))

Jonathan Pryor jonpryor at vt.edu
Fri May 27 18:33:52 EDT 2005


On Fri, 2005-05-27 at 15:43 -0400, Ben Maurer wrote:
> Hello,
> 
> The attached patch makes mcs emit an added-value warning: it warns when
> you lock on a string or System.Type.

Good idea overall, though I'd suggest a slight change warn whenever you
lock on a public member.  This would catch both System.Type and string
(both are public members), and it's generally not safe to lock on public
members for the same reasons locking on string or System.Type is unsafe
(increased possibility for deadlock being the primary issue).

 - Jon





More information about the Mono-devel-list mailing list