[folks] Cut unnecessary locking in Tracker backend tests.
- From: Jeremy Whiting <jpwhiting src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Cut unnecessary locking in Tracker backend tests.
- Date: Mon, 23 Jul 2012 17:27:27 +0000 (UTC)
commit 0a21e25cfd8753185e21653d1f0c5c3b85c38dab
Author: Travis Reitter <travis reitter collabora co uk>
Date: Wed Jul 6 18:13:36 2011 -0700
Cut unnecessary locking in Tracker backend tests.
Closes: bgo#652637 - Don't hold locks across async calls
NEWS | 1 +
tests/tracker/add-persona.vala | 10 +++-------
tests/tracker/duplicated-emails.vala | 10 +++-------
tests/tracker/duplicated-phones.vala | 10 +++-------
tests/tracker/match-all.vala | 10 +++-------
tests/tracker/match-email-addresses.vala | 10 +++-------
tests/tracker/match-im-addresses.vala | 10 +++-------
tests/tracker/match-known-emails.vala | 10 +++-------
tests/tracker/match-name.vala | 10 +++-------
tests/tracker/match-phone-number.vala | 10 +++-------
tests/tracker/set-duplicate-email.vala | 10 +++-------
11 files changed, 31 insertions(+), 70 deletions(-)
---
diff --git a/NEWS b/NEWS
index 76ef52c..10b41ad 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ Bugs fixed:
â Bug 669158 â Readonly/Offline issues
â Bug 675223 â Shouldn't warn if CM does not implement any contact list
â Bug 660128 â Most contacts don't have an avatar
+â Bug 652637 â Don't hold locks across async calls
API changes:
â Add AntiLinkable interface and implement it on Kf.Persona and Edsf.Persona
diff --git a/tests/tracker/add-persona.vala b/tests/tracker/add-persona.vala
index 746de90..dec6cfe 100644
--- a/tests/tracker/add-persona.vala
+++ b/tests/tracker/add-persona.vala
@@ -393,14 +393,10 @@ public class AddPersonaTests : Folks.TestCase
private void _try_to_add ()
{
- lock (this._added_persona)
+ if (this._pstore.is_prepared && this._added_persona == false)
{
- if (this._pstore.is_prepared &&
- this._added_persona == false)
- {
- this._added_persona = true;
- this._add_persona ();
- }
+ this._added_persona = true;
+ this._add_persona ();
}
}
diff --git a/tests/tracker/duplicated-emails.vala b/tests/tracker/duplicated-emails.vala
index 677119f..1c1534c 100644
--- a/tests/tracker/duplicated-emails.vala
+++ b/tests/tracker/duplicated-emails.vala
@@ -141,14 +141,10 @@ public class DuplicatedEmailsTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/duplicated-phones.vala b/tests/tracker/duplicated-phones.vala
index 162b895..873b575 100644
--- a/tests/tracker/duplicated-phones.vala
+++ b/tests/tracker/duplicated-phones.vala
@@ -141,14 +141,10 @@ public class DuplicatedPhonesTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-all.vala b/tests/tracker/match-all.vala
index 7a9f7f6..a41bd66 100644
--- a/tests/tracker/match-all.vala
+++ b/tests/tracker/match-all.vala
@@ -198,14 +198,10 @@ public class MatchAllTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-email-addresses.vala b/tests/tracker/match-email-addresses.vala
index ab09c04..4baaf1c 100644
--- a/tests/tracker/match-email-addresses.vala
+++ b/tests/tracker/match-email-addresses.vala
@@ -153,14 +153,10 @@ public class MatchEmailAddressesTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-im-addresses.vala b/tests/tracker/match-im-addresses.vala
index 4d7957f..8359390 100644
--- a/tests/tracker/match-im-addresses.vala
+++ b/tests/tracker/match-im-addresses.vala
@@ -153,14 +153,10 @@ public class MatchIMAddressesTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-known-emails.vala b/tests/tracker/match-known-emails.vala
index ba67281..2d93fe0 100644
--- a/tests/tracker/match-known-emails.vala
+++ b/tests/tracker/match-known-emails.vala
@@ -161,14 +161,10 @@ public class MatchKnownEmailsTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-name.vala b/tests/tracker/match-name.vala
index dbf2364..aab95d0 100644
--- a/tests/tracker/match-name.vala
+++ b/tests/tracker/match-name.vala
@@ -213,14 +213,10 @@ public class MatchNameTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/match-phone-number.vala b/tests/tracker/match-phone-number.vala
index 044d9e5..cd9384b 100644
--- a/tests/tracker/match-phone-number.vala
+++ b/tests/tracker/match-phone-number.vala
@@ -155,14 +155,10 @@ public class MatchPhoneNumberTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
diff --git a/tests/tracker/set-duplicate-email.vala b/tests/tracker/set-duplicate-email.vala
index 4b9770b..6902ba7 100644
--- a/tests/tracker/set-duplicate-email.vala
+++ b/tests/tracker/set-duplicate-email.vala
@@ -175,14 +175,10 @@ public class SetDuplicateEmailTests : Folks.TestCase
private async void _try_to_add ()
{
- lock (this._added_personas)
+ if (this._pstore.is_prepared && this._added_personas == false)
{
- if (this._pstore.is_prepared &&
- this._added_personas == false)
- {
- this._added_personas = true;
- yield this._add_personas ();
- }
+ this._added_personas = true;
+ yield this._add_personas ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]