Examples of errors detected by the V3090 diagnostic
V3090. Unsafe locking on an object.
Old NASA World Wind (C#)
V3090 Unsafe locking on an object of type 'String'. GPSTrackerPlugin.APRS.cs 256
private int APRSParse(....)
{
int iRet=-1;
try
{
lock("ExternDllAccess")
{
//Call the APRS DLL
iRet=APRSParseLinePosStat(sString,
ref aprsPosition,
ref aprsStatus);
}
}
catch(Exception)
{
iRet=-1;
}
return iRet;
}
Similar errors can be found in some other places:
- V3090 Unsafe locking on an object of type 'String'. GPSTrackerPlugin.File.cs 226
- V3090 Unsafe locking on an object of type 'String'. GPSTrackerPlugin.File.cs 244
- V3090 Unsafe locking on an object of type 'String'. GPSTrackerPlugin.File.cs 370
- And 12 additional diagnostic messages.
Mono
V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. corlib-net_4_x UnixRegistryApi.cs 245
public RegistryKey Ensure (....)
{
lock (typeof (KeyHandler)){
....
}
}
Similar errors can be found in some other places:
- V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. corlib-net_4_x UnixRegistryApi.cs 261
- V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. corlib-net_4_x UnixRegistryApi.cs 383
- V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. corlib-net_4_x UnixRegistryApi.cs 404
- And 8 additional diagnostic messages.
Mono
V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. System.Runtime.Remoting-net_4_x HttpRemotingHandlerFactory.cs 61
void ConfigureHttpChannel (HttpContext context)
{
lock (GetType())
{
....
}
}
Mono
V3090 Unsafe locking on an object of type 'String'. System.Web-net_4_x ProfileBase.cs 95
const string Profiles_SettingsPropertyCollection =
"Profiles.SettingsPropertyCollection";
....
static void InitProperties ()
{
....
lock (Profiles_SettingsPropertyCollection) {
if (_properties == null)
_properties = properties;
}
}
Logify Alert Clients
V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. TempDirectoryExceptionReportSender.cs 33
protected override bool SendExceptionReportCore(....) {
....
lock (typeof(OfflineDirectoryExceptionReportSender)) {
....
}
Emby
V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. Lmhosts.cs 49
public class Lmhosts
{
public static NbtAddress GetByName(string host)
{
lock (typeof(Lmhosts))
{
return GetByName(new Name(host, 0x20, null));
}
}
internal static NbtAddress GetByName(Name name)
{
lock (typeof(Lmhosts))
{
....
}
}
}
Similar errors can be found in some other places:
- V3090 Unsafe locking on a type. All instances of a type will have the same 'Type' object. Lmhosts.cs 57