Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,23 @@
2009-06-15 Atsushi Enomoto <atsushi@ximian.com>
* ReaderWriterLockSlim.cs : fix deadlock when entered
read lock -> entered writer lock -> exited writer lock
-> exited read lock and then entered reader lock.
Fixed bug #512485, patch by Kazuki Oikawa.
2009-06-10 Marek Safar <marek.safar@gmail.com>
* LockRecursionException.cs: Updated to 4.0 changes.
2009-01-18 Marek Safar <marek.safar@gmail.com>
* ReaderWriterLockSlim.cs: Implemented all properties.
2008-12-02 Marek Safar <marek.safar@gmail.com>
* ReaderWriterLockSlim.cs: Initial merge.
2008-09-05 Marek Safar <marek.safar@gmail.com>
* ChangeLog: Added

View File

@ -0,0 +1,66 @@
/*
* System.Threading.LockRecursionException
*
* Author(s)
* Marek Safar <marek.safar@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if NET_4_0
using System;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof(System.Threading.LockRecursionException))]
#else
using System;
using System.Runtime.Serialization;
namespace System.Threading
{
[Serializable]
public class LockRecursionException : Exception
{
public LockRecursionException ()
: base ()
{
}
public LockRecursionException (string message)
: base (message)
{
}
public LockRecursionException (string message, Exception e)
: base (message, e)
{
}
protected LockRecursionException (SerializationInfo info, StreamingContext sc)
: base (info, sc)
{
}
}
}
#endif

View File

@ -0,0 +1,36 @@
/*
* System.Threading.LockRecursionPolicy
*
* Author(s)
* Marek Safar <marek.safar@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
namespace System.Threading
{
[Serializable]
public enum LockRecursionPolicy
{
NoRecursion,
SupportsRecursion
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
//
// ReaderWriterLockSlimExtensions.cs
//
// Author:
// Jérémie "Garuma" Laval <jeremie.laval@gmail.com>
//
// Copyright (c) 2010 Jérémie "Garuma" Laval
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Threading
{
internal static class ReaderWriterLockSlimExtensions
{
internal static bool Has (this LockState state, LockState value)
{
return (state & value) > 0;
}
#if !NET_4_0
internal static bool Wait (this ManualResetEvent self, int timeout)
{
return self.WaitOne (timeout);
}
internal static bool IsSet (this ManualResetEvent self)
{
return self.WaitOne (0);
}
#else
internal static bool IsSet (this ManualResetEventSlim self)
{
return self.IsSet;
}
#endif
}
}

View File

@ -0,0 +1,51 @@
//
// ThreadLockState.cs
//
// Author:
// Jérémie "Garuma" Laval <jeremie.laval@gmail.com>
//
// Copyright (c) 2010 Jérémie "Garuma" Laval
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
namespace System.Threading
{
[Flags]
internal enum LockState
{
None = 0,
Upgradable = 1,
Read = 2,
Write = 4,
UpgradedRead = Upgradable | Read,
UpgradedWrite = Upgradable | Write
}
internal class ThreadLockState
{
public LockState LockState;
public int ReaderRecursiveCount;
public int WriterRecursiveCount;
public int UpgradeableRecursiveCount;
}
}