Same for PushRange. Yes your code behave the same here.
But I don't know why my app does not. Here I am pushing a stack of 4
elements into an empty stack and it fails as well as with 1 element pushed.
[image: Inline image 2]
On Thu, May 24, 2012 at 5:14 PM, Jonathan Pryor-2 [via Mono for Android] <
ml-node+s1047100n571000...@n5.nabble.com> wrote:
> On May 24, 2012, at 3:15 AM, gpe wrote:
> > I am using the generic ConcurrentStack in some of my code. And when
> using it on monodroid I noticed that the method PushRange and TryPopRange
> do not work.
>
> Can you elaborate? It is implemented, but I have found a bug wherein
> arrays of length 1 don't work. Use an array that holds more than one
> element, and it works:
>
> var s = new ConcurrentStack<int> ();
> s.PushRange (new []{5,4,3,2,1});
> int[] b = new int[3];
> int n;
> if ((n = s.TryPopRange (b)) > 0) {
> Console.WriteLine ("Popped range! n={0}; contents: {1}",
> n, string.Join (", ", b));
> }
> Console.WriteLine ("s contents: {0}", string.Join (", ", s));
>
> The above prints:
>
> Popped range! n=2; contents: 1, 2, 3
> s contents: 3, 4, 5
>
> However, if I change the length of `b` to contain 1 element, nothing is
> popped. This appears to be a bug:
>
> https://bugzilla.xamarin.com/show_bug.cgi?id=5304
>
> - Jon
>
> _______________________________________________
> Monodroid mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5710007&i=0>
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://mono-for-android.1047100.n5.nabble.com/ConcurrentStack-PushRange-not-implemented-tp5710004p5710007.html
> To unsubscribe from ConcurrentStack<>.PushRange not implemented?, click
> here<http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5710004&code=Z3BlLm1wcm9AZ29vZ2xlbWFpbC5jb218NTcxMDAwNHwxMzU2MTA3Mjc1>
> .
> NAML<http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
Regards,
Gpe
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/ConcurrentStack-PushRange-not-implemented-tp5710004p5710020.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid