[ I hope this is the right list, if not please redirect me
  to the right one, thanks! ]

Hi, this is a bit long, because I don't know what
is relevant to the problem and what it is not.

I'm testing the wxPerl wrapper around the wxWindows C++ class library
with ithreads; I'm using perl@15627, Win32, MSVC5

I have a C++ function from wxWindows ( wxPostEvent ) that takes a
wxEvent, calls
a method on it to obtain a copy, appends the copy to
a queue ( this tipically happens in a worker thread ).
Then the main thread picks up the events in the queue
and dispatches them to the appropriate event handler.

At the Perl level the function takes a Wx::Event
( a blessed hashref, containing a pointer to a
  wxPlEvent ), and passes it to wxPostEvent.
In the main thread a specialized dispatch functions
extracts the blessed hashref from one of wxPlEvent members
and calls a Perl function with the hashref as argument.

This is somewhat working ( the function in the main thread is
called with a blessed hashref, and it contains the right keys and the
right values ), but I get various errors like

! Use of uninitialized value in subroutine entry at 
! C:/Developement/wxPerl/wxPerl/demo/wxThread.pm line 88.
when I try to call a method on the object

! Attempt to free non-existent shared string 'VALUE' at demo\demo.pl
! line 412.
when the object is destroyed

Now I understand the errors come from the fact that I create
the hashref in one thread and pass the pointer to another thread,
so I tried to call threads::shared::share on it, but this
fails with

! Invalid value for shared scalar at
! C:/Developement/wxPerl/wxPerl/demo/wxThread.pm line 101.

Could someone clue me ( or point me to the docs )?

Thanks!
Mattia

Reply via email to