aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Notifications
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-12-13 13:27:53 -0500
committerGitHub <noreply@github.com>2016-12-13 13:27:53 -0500
commit6cdbb25b9d756b58806414455cc4c4d1bc555217 (patch)
treeb6bc4f10ad1c6f758215a719b2be932b5979e896 /Emby.Server.Implementations/Notifications
parentb33dcdf7bd61a8096928e1b2b5e34af1c8373096 (diff)
parentffad9c27e4844eeab235f88cb45739370d22a83a (diff)
Merge pull request #2340 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Notifications')
-rw-r--r--Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
index 43e19da65..f18278cb2 100644
--- a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
+++ b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs
@@ -65,9 +65,9 @@ namespace Emby.Server.Implementations.Notifications
var whereClause = " where " + string.Join(" And ", clauses.ToArray());
- using (var connection = CreateConnection(true))
+ using (WriteLock.Read())
{
- lock (WriteLock)
+ using (var connection = CreateConnection(true))
{
result.TotalRecordCount = connection.Query("select count(Id) from Notifications" + whereClause, paramList.ToArray()).SelectScalarInt().First();
@@ -106,9 +106,9 @@ namespace Emby.Server.Implementations.Notifications
{
var result = new NotificationsSummary();
- using (var connection = CreateConnection(true))
+ using (WriteLock.Read())
{
- lock (WriteLock)
+ using (var connection = CreateConnection(true))
{
using (var statement = connection.PrepareStatement("select Level from Notifications where UserId=@UserId and IsRead=@IsRead"))
{
@@ -223,9 +223,9 @@ namespace Emby.Server.Implementations.Notifications
cancellationToken.ThrowIfCancellationRequested();
- using (var connection = CreateConnection())
+ lock (WriteLock)
{
- lock (WriteLock)
+ using (var connection = CreateConnection())
{
connection.RunInTransaction(conn =>
{
@@ -286,9 +286,9 @@ namespace Emby.Server.Implementations.Notifications
{
cancellationToken.ThrowIfCancellationRequested();
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
- lock (WriteLock)
+ using (var connection = CreateConnection())
{
connection.RunInTransaction(conn =>
{
@@ -308,9 +308,9 @@ namespace Emby.Server.Implementations.Notifications
{
cancellationToken.ThrowIfCancellationRequested();
- using (var connection = CreateConnection())
+ using (WriteLock.Write())
{
- lock (WriteLock)
+ using (var connection = CreateConnection())
{
connection.RunInTransaction(conn =>
{