[blam] Channel: Also use locking
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] Channel: Also use locking
- Date: Thu, 14 Oct 2010 12:43:52 +0000 (UTC)
commit 1b32e4ac544d5d139b4ba8bddf4651bda5463c1f
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Mon Oct 11 21:30:18 2010 +0100
Channel: Also use locking
src/Channel.cs | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/Channel.cs b/src/Channel.cs
index 72e5985..a376380 100644
--- a/src/Channel.cs
+++ b/src/Channel.cs
@@ -196,8 +196,10 @@ namespace Imendio.Blam {
{
this.LastRefreshed = DateTime.Now;
ArrayList tmp = new ArrayList();
- foreach(string id in item_list){
- tmp.Add(store.Items[id]);
+ lock(obj){
+ foreach(string id in item_list){
+ tmp.Add(store.Items[id]);
+ }
}
mUnupdatedItems = tmp;
}
@@ -215,8 +217,10 @@ namespace Imendio.Blam {
continue;
}
- item_list.Remove(item.Id);
- store.Remove(item);
+ lock(obj){
+ item_list.Remove(item.Id);
+ store.Remove(item);
+ }
}
}
@@ -229,7 +233,7 @@ namespace Imendio.Blam {
{
store.Add(item);
item_list.Add(item.Id);
- item.Updated += ItemUpdated;
+ (store.Items[id] as Item).Updated += ItemUpdated;
}
/* Used to cross-mark as read */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]