On Sat, 18 Oct 2008, [EMAIL PROTECTED] wrote:

> Hi,
>  I have a class that I run in a thread, but I can't seem to get PyLucene
> to attach to the thread. The code below throws a seg fault. Is there
> something different I need to do when spawning threads from a context
> that already has a vm running?
>
> thanks.
> Darren
>
> class extractor(Thread):
>   def __init__ (self,text,auto,lang):
>      Thread.__init__(self)
>
>      self.text = text
>      self.auto = auto
>      self.lang = lang
>      self.status = -1
>   def run(self):
>      vm=initVM(CLASSPATH)
>      vm.attachCurrentThread()

The first time initVM() is called, it must be called from the main thread.
To get the vm again, use the getVMEnv() function.

Andi..

_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to