I'm trying to build a custom directory implementation, actually the directory itself just fallback to one of the existing directory implementations, so it's actually more about IndexInput/IndexOutput.

I have some concerns about my implementation, especially related to multithreading:
How this issue is solved in Lucene? what should I do to make sure that my implementation doing right thing?

Currently I'm on Lucene 4.0.0 BETA