Re: Issue calling methods using std.concurrency

2012-04-25 Thread Casey
Stanislav: I think you just hit the nail on the head with the shared reference to this. I didn't even think of that as the error message made me think of the parameter being shared. As for solving it, I'll have to think about it. I was hoping to just have a single queue class (Or any other

Re: Issue calling methods using std.concurrency

2012-04-23 Thread Casey
On Monday, 23 April 2012 at 02:34:19 UTC, Ali Çehreli wrote: This works at least with 2.059 on 64-bit Linux: import std.stdio; import std.concurrency; import core.thread; class Foo { int i; } void workerFunc(Tid owner) { receive( (shared(Foo) foo) { writeln(Before:

Re: Issue calling methods using std.concurrency

2012-04-23 Thread Ali Çehreli
On 04/23/2012 11:44 AM, Casey wrote: I actually did print out the value being passed successfully. It's just that when I used the queue methods (enqueue and dequeue), it get this error. The queue itself is shared, but none of the methods are expecting a shared value nor do I believe they

Re: Issue calling methods using std.concurrency

2012-04-23 Thread Stanislav Blinov
On Monday, 23 April 2012 at 18:44:37 UTC, Casey wrote: I actually did print out the value being passed successfully. It's just that when I used the queue methods (enqueue and dequeue), it get this error. The queue itself is shared, but none of the methods are expecting a shared value nor

Issue calling methods using std.concurrency

2012-04-22 Thread Casey
Hello, I'm getting some errors when I wrap a struct that I've written with another struct. Here are the errors I'm getting: tqueue.d(14): Error: function queue.Queue!(int).Queue.enqueue (int value) is not callable using argument types (int) shared tqueue.d(15): Error: function

Re: Issue calling methods using std.concurrency

2012-04-22 Thread Ali Çehreli
On 04/22/2012 07:15 PM, Casey wrote: Hello, I'm getting some errors when I wrap a struct that I've written with another struct. Here are the errors I'm getting: tqueue.d(14): Error: function queue.Queue!(int).Queue.enqueue (int value) is not callable using argument types (int) shared