Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@@ -57,6 +57,11 @@ namespace System.Diagnostics {
// Cache the last position scanned in sb when searching for lines.
private int currentLinePos;
#if MONO
//users to coordinate between Dispose and BeginReadLine
private object syncObject = new Object ();
#endif
internal AsyncStreamReader(Process process, Stream stream, UserCallBack callback, Encoding encoding)
: this(process, stream, callback, encoding, DefaultBufferSize) {
}
@@ -104,6 +109,9 @@ namespace System.Diagnostics {
protected virtual void Dispose(bool disposing)
{
#if MONO
lock (syncObject) {
#endif
if (disposing) {
if (stream != null)
stream.Close();
@@ -120,6 +128,9 @@ namespace System.Diagnostics {
eofEvent.Close();
eofEvent = null;
}
#if MONO
}
#endif
}
public virtual Encoding CurrentEncoding {
@@ -155,6 +166,12 @@ namespace System.Diagnostics {
int byteLen;
try {
#if MONO
var stream = this.stream;
if (stream == null)
byteLen = 0;
else
#endif
byteLen = stream.EndRead(ar);
}
catch (IOException ) {
@@ -171,6 +188,9 @@ namespace System.Diagnostics {
byteLen = 0; // Treat this as EOF
}
#if MONO
retry_dispose:
#endif
if (byteLen == 0) {
// We're at EOF, we won't call this function again from here on.
lock(messageQueue) {
@@ -186,13 +206,45 @@ namespace System.Diagnostics {
FlushMessageQueue();
}
finally {
#if MONO
lock (syncObject) {
if (eofEvent != null) {
try {
eofEvent.Set ();
} catch (System.ObjectDisposedException) {
// This races with Dispose, it's safe to ignore the error as it comes from a SafeHandle doing its job
}
}
}
#else
eofEvent.Set();
#endif
}
} else {
#if MONO
lock (syncObject) {
if (decoder == null) { //we got disposed after the EndRead, retry as Diposed
byteLen = 0;
goto retry_dispose;
}
#endif
int charLen = decoder.GetChars(byteBuffer, 0, byteLen, charBuffer, 0);
sb.Append(charBuffer, 0, charLen);
#if MONO
}
#endif
GetLinesFromStringBuilder();
#if MONO
lock (syncObject) {
if (stream == null) { //we got disposed after the EndRead, retry as Diposed
byteLen = 0;
goto retry_dispose;
}
#endif
stream.BeginRead(byteBuffer, 0 , byteBuffer.Length, new AsyncCallback(ReadBuffer), null);
#if MONO
}
#endif
}
}

View File

@@ -1 +1 @@
cbd2456ab966dcad784e6055e16ea4b2a7964721
6fbeb99f020d1dbe0c11bf3f34f0a6002307c13e

View File

@@ -53,6 +53,270 @@ namespace System.Diagnostics {
public void CopyTo(ProcessModule[] array, int index) {
InnerList.CopyTo(array, index);
}
#if MOBILE
[Obsolete ("This API is no longer available", true)]
public int Capacity {
get {
throw new NotSupportedException ();
}
set {
throw new NotSupportedException ();
}
}
[Obsolete ("This API is no longer available", true)]
public void Add (ProcessModule item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void AddRange (System.Collections.Generic.IEnumerable<ProcessModule> collection)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.ObjectModel.ReadOnlyCollection<ProcessModule> AsReadOnly()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(int index, int count, ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(ProcessModule item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Clear()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessModule,TOutput> converter)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void CopyTo(ProcessModule[] array)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void CopyTo(int index, ProcessModule[] array, int arrayIndex, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public bool Exists(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessModule Find(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<ProcessModule> FindAll(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(int startIndex, Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(int startIndex, int count, Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessModule FindLast(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(int startIndex, Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(int startIndex, int count, Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void ForEach(Action<ProcessModule> action)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<ProcessModule> GetRange(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int IndexOf(ProcessModule item, int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int IndexOf(ProcessModule item, int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Insert(int index, ProcessModule item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessModule> collection)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessModule item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessModule item, int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessModule item, int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public bool Remove(ProcessModule item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int RemoveAll(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void RemoveAt(int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void RemoveRange(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Reverse()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Reverse(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(System.Collections.Generic.IComparer<ProcessModule> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessModule> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(Comparison<ProcessModule> comparison)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessModule[] ToArray()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void TrimExcess()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public bool TrueForAll(Predicate<ProcessModule> match)
{
throw new NotSupportedException ();
}
#endif
}
}

View File

@@ -77,6 +77,252 @@ namespace System.Diagnostics {
public void CopyTo(ProcessThread[] array, int index) {
InnerList.CopyTo(array, index);
}
#if MOBILE
[Obsolete ("This API is no longer available", true)]
public int Capacity {
get {
throw new NotSupportedException ();
}
set {
throw new NotSupportedException ();
}
}
[Obsolete ("This API is no longer available", true)]
public void AddRange (System.Collections.Generic.IEnumerable<ProcessThread> collection)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.ObjectModel.ReadOnlyCollection<ProcessThread> AsReadOnly()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(int index, int count, ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(ProcessThread item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int BinarySearch(ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Clear()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessThread,TOutput> converter)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void CopyTo(ProcessThread[] array)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void CopyTo(int index, ProcessThread[] array, int arrayIndex, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public bool Exists(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessThread Find(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<ProcessThread> FindAll(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(int startIndex, Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindIndex(int startIndex, int count, Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessThread FindLast(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(int startIndex, Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int FindLastIndex(int startIndex, int count, Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void ForEach(Action<ProcessThread> action)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public System.Collections.Generic.List<ProcessThread> GetRange(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int IndexOf(ProcessThread item, int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int IndexOf(ProcessThread item, int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessThread> collection)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessThread item)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessThread item, int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int LastIndexOf(ProcessThread item, int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public int RemoveAll(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void RemoveAt(int index)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void RemoveRange(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Reverse()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Reverse(int index, int count)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(System.Collections.Generic.IComparer<ProcessThread> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessThread> comparer)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void Sort(Comparison<ProcessThread> comparison)
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public ProcessThread[] ToArray()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public void TrimExcess()
{
throw new NotSupportedException ();
}
[Obsolete ("This API is no longer available", true)]
public bool TrueForAll(Predicate<ProcessThread> match)
{
throw new NotSupportedException ();
}
#endif
}
}