* SafeHandle.cs: Use refcount == -1 to indicate that the handle
had been closed.
The problem here is that we have no records of why the code that
threw a ObjectDisposedException inside the do { } while block on
DangerousAddRef was added. It seems it was added in response to
Close() methods being called and the need to throw that exception
on further calls to ObjectDisposedException.
Sadly, we have no test suites for that.
svn path=/trunk/mcs/; revision=154741
* ConsoleTest.cs: added a bunch of tests for the standard input,
output and error stream properties.
2009-03-23 Marek Habersack <[email protected]>
* FileStreamTest.cs: added a bunch of tests for SafeFileHandle
constructors
2009-03-23 Marek Habersack <[email protected]>
* Console.cs: OpenStandard{Input,Output,Error} no longer use
FileStream on 2.0+. The reason is that SafeFileHandle used in the
stream doesn't allow handles with values <= 0, and on Unix stdin
is 0 which would break the Console class. Instead of FileStream,
introduced a simple internal specialized stream which is used in
this scenario.
2009-03-23 Marek Habersack <[email protected]>
* FileStream.cs: implemented full support for SafeFileHandle in
2.0. The obsolete constructors taking an IntPtr now wrap it in a
SafeFileHandle.
2009-03-23 Marek Habersack <[email protected]>
* SafeHandle.cs: added an internal property, OwnsHandle, used by
FileStream.
svn path=/trunk/mcs/; revision=130049
* SafeHandle.cs: Harden this, do not call ReleaseHandle if the
handle is invalid.
* CriticalHandle.cs: Harden this, do not call ReleaseHandle if the
handle is invalid.
svn path=/trunk/mcs/; revision=82260
* SafeHandle.cs: Do not use locks in SafeHandle to protect the
access to the refcount, use Interlocked.CompareExchange. The
locks were the source of problems with domain finalization when
this code was enabled.
This should fix Matt Hargett's bug report with a full `make check'
that reported variations of:
** (../../class/lib/net_2_0/nunit-console.exe:29644): WARNING **:
Finalization of domain <domainname> timed out.
Also, it is a lot lighther.
svn path=/trunk/mcs/; revision=70433
* SafeHandle.cs: Fix a handful of bugs, and add tests for them.
Only release the handle if its owned by us. Also throw
ObjectDisposedException's
svn path=/trunk/mcs/; revision=69378
2006-12-11 Miguel de Icaza <[email protected]>
* SafeHandle.cs: Implement finalizer.
DangerousAddRef will now throw an exception if the object was
disposed.
2006-12-10 Miguel de Icaza <[email protected]>
* SafeFileHandle.cs: Implement this one.
svn path=/trunk/mcs/; revision=69296
* SafeHandle.cs: Implement this class.
2006-12-02 Miguel de Icaza <[email protected]>
* SafeFileHandle.cs: Remove the IsInvalid method, as that is
present in the base class.
svn path=/trunk/mcs/; revision=68875
2006-01-12 Ben Maurer <[email protected]>
* SafeHandleZeroOrMinusOneIsInvalid.cs: Update to RTM api
* SafeFileHandle.cs: Update to RTM api
In System.Runtime.InteropServices:
2006-01-12 Ben Maurer <[email protected]>
* SafeHandle.cs: Update to RTM api
svn path=/trunk/mcs/; revision=55474