Your function has some contradictions:
- initVM() must be called from the main thread
- attachCurrentThread() makes sense only when called from threads other than the main one

The main thread is the thread which creates the other threads, right? And after initVM is called, lucene.getVMEnv() always returns a valid environment (for all threads), right?

In this case, my function works because I call it once before starting the server (which creates the worker threads) and all workers just do attachCurrentThread.

But thanks for the hint, I will rework it to make my code more obvious.

fs

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

Reply via email to