[blam] Also don't use an extra object to lock
- From: Carlos MartÃn Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] Also don't use an extra object to lock
- Date: Wed, 24 Aug 2011 14:20:44 +0000 (UTC)
commit 4390cd1ea1c45358219cd175417407cf337f2fe9
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Wed Aug 24 01:17:12 2011 +0200
Also don't use an extra object to lock
Signed-off-by: Carlos MartÃn Nieto <carlos cmartin tk>
src/ItemStore.cs | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/ItemStore.cs b/src/ItemStore.cs
index 5845fba..834d5ff 100644
--- a/src/ItemStore.cs
+++ b/src/ItemStore.cs
@@ -16,7 +16,6 @@ namespace Imendio.Blam
static ItemStore instance = null;
static string itemfile = Defines.APP_HOMEDIR + "/" + Defines.APP_ITEMSTORE_FILE;
static string itemfile_tmp = Defines.APP_HOMEDIR + "/" + Defines.APP_ITEMSTORE_FILE + ".tmp";
- private static object cache_lock = new object();
public static Item Get(string id)
{
@@ -28,7 +27,7 @@ namespace Imendio.Blam
if(instance == null)
Load();
- lock(cache_lock){
+ lock(instance.cache){
if(instance.cache.ContainsKey(id))
return instance.cache[id] as Item;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]