summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-08 19:16:04 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-02-08 19:16:04 +0000
commit4509656fd05de1590d5dd0d1e6429957861d00e0 (patch)
treed2f24f7380c99ec73e5b92b8d8e1c4250ce854c0
parent2a1c6fc96ff03c84723ca1fb7d3a48e0cd3df115 (diff)
no need to adjust the updateSerial depending on the updateMutex... just increment before the update :o)
-rw-r--r--src/trg-main-window.c4
-rw-r--r--src/trg-torrent-tree-view.c7
2 files changed, 3 insertions, 8 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index fe650c0..b8fdd3f 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -953,6 +953,8 @@ on_torrent_get_multipurpose(JsonObject * response, gboolean first,
g_mutex_lock(client->updateMutex);
+ client->updateSerial++;
+
trg_torrent_model_update(priv->torrentModel, priv->client,
response, &stats, first);
@@ -964,8 +966,6 @@ on_torrent_get_multipurpose(JsonObject * response, gboolean first,
g_timeout_add_seconds(3, trg_update_torrents_timerfunc, data);
- client->updateSerial++;
-
gdk_threads_leave();
response_unref(response);
}
diff --git a/src/trg-torrent-tree-view.c b/src/trg-torrent-tree-view.c
index 43a49db..b0c8e2a 100644
--- a/src/trg-torrent-tree-view.c
+++ b/src/trg-torrent-tree-view.c
@@ -77,17 +77,12 @@ gint get_first_selected(trg_client *client, TrgTorrentTreeView * view, GtkTreeIt
if ((firstNode = g_list_first(selectionList)) != NULL) {
if (gtk_tree_model_get_iter(model, iter, firstNode->data) == TRUE) {
- gboolean locked;
gtk_tree_model_get(model, iter,
TORRENT_COLUMN_JSON, json,
TORRENT_COLUMN_ID, &id,
TORRENT_COLUMN_UPDATESERIAL, &updateSerial, -1);
- locked = g_mutex_trylock(client->updateMutex);
- if (locked)
- g_mutex_unlock(client->updateMutex);
-
- if (updateSerial < (locked ? client->updateSerial-1 : client->updateSerial))
+ if (updateSerial < client->updateSerial)
id = -1;
}
}