Global.getWriterModifier (what, create)
Tries to create a new IndexWriter or IndexModifier for up to the number of milliseconds defined in helma.Search.Index.LOCK_TIMEOUT.

Sourcecode in /home/hannes/helma/modules/helma/Search.js:
245:   var getWriterModifier = function(what, create) {
246:           var waitFor, elapsed = 0;
247:           while (elapsed < helma.Search.Index.LOCK_TIMEOUT) {
248:               if (!this.isLocked()) {
249:                   return new Packages.org.apache.lucene.index[what](directory,
250:                                      analyzer, create == true ? true : false);
251:               } else {
252:                   waitFor = Math.round(Math.random() * 100) + 50;
253:                   java.lang.Thread.sleep(waitFor);
254:                  elapsed += waitFor;
255:                  app.logger.debug("[Thread " + java.lang.Thread.currentThread().getId()
256:                                   + "] waiting for " + elapsed + "ms");
257:              }
258:          }
259:          throw("Failed to create " + what + " due to active lock (Thread "
260:                + java.lang.Thread.currentThread().getId() + ")");
261:      }