You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by mf...@apache.org on 2014/05/27 15:44:03 UTC

[9/9] git commit: STREAMS-86 | Added write lock when we reassign the queue's reference in the prepare method

STREAMS-86 | Added write lock when we reassign the queue's reference in the prepare method


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/12af7b31
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/12af7b31
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/12af7b31

Branch: refs/heads/master
Commit: 12af7b31ac5a4569fb5704f74c422124a7f225bb
Parents: 7cabbf3
Author: Robert Douglas <rd...@w2odigital.com>
Authored: Mon May 19 14:03:34 2014 -0500
Committer: mfranklin <mf...@apache.org>
Committed: Tue May 27 09:33:21 2014 -0400

----------------------------------------------------------------------
 .../streams/twitter/provider/TwitterTimelineProvider.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/12af7b31/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
index 7db81a3..8927577 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
@@ -282,10 +282,14 @@ public class TwitterTimelineProvider implements StreamsProvider, Serializable {
 
         client = getTwitterClient();
 
-        providerQueue = constructQueue();
+        try {
+            lock.writeLock().lock();
+            providerQueue = constructQueue();
+        } finally {
+            lock.writeLock().unlock();
+        }
     }
 
-
     protected Twitter getTwitterClient()
     {
         String baseUrl = "https://api.twitter.com:443/1.1/";