Skip to content

Commit

Permalink
Merge pull request praeclarum#617 from FatJohn/master
Browse files Browse the repository at this point in the history
use default parameter to Task.Factory.StartNew to do the same as Task.Run
  • Loading branch information
praeclarum authored Aug 24, 2017
2 parents 786f940 + 32ef5e6 commit de7afe9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/SQLiteAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public Task CloseAsync ()
{
return Task.Factory.StartNew (() => {
SQLiteConnectionPool.Shared.CloseConnection (_connectionString, _openFlags);
});
}, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}

Task<T> ReadAsync<T> (Func<SQLiteConnectionWithLock, T> read)
Expand All @@ -190,7 +190,7 @@ Task<T> ReadAsync<T> (Func<SQLiteConnectionWithLock, T> read)
using (conn.Lock ()) {
return read (conn);
}
});
}, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}

Task<T> WriteAsync<T> (Func<SQLiteConnectionWithLock, T> write)
Expand All @@ -200,7 +200,7 @@ Task<T> WriteAsync<T> (Func<SQLiteConnectionWithLock, T> write)
using (conn.Lock ()) {
return write (conn);
}
});
}, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}

/// <summary>
Expand Down Expand Up @@ -1155,7 +1155,7 @@ Task<U> ReadAsync<U> (Func<SQLiteConnectionWithLock, U> read)
using (conn.Lock ()) {
return read (conn);
}
});
}, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}

Task<U> WriteAsync<U> (Func<SQLiteConnectionWithLock, U> write)
Expand All @@ -1165,7 +1165,7 @@ Task<U> WriteAsync<U> (Func<SQLiteConnectionWithLock, U> write)
using (conn.Lock ()) {
return write (conn);
}
});
}, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}

/// <summary>
Expand Down

0 comments on commit de7afe9

Please sign in to comment.