1
/*------------------------------------------------------------------------------
2
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
4
* Distributable under the terms of either the Apache License (Version 2.0) or
5
* the GNU Lesser General Public License, as specified in the COPYING file.
6
------------------------------------------------------------------------------*/
7
#include "CLucene/StdHeader.h"
12
bool LuceneLock::obtain(int64_t lockWaitTimeout) {
13
bool locked = obtain();
14
int maxSleepCount = (int)(lockWaitTimeout / LOCK_POLL_INTERVAL);
17
if (sleepCount++ == maxSleepCount) {
18
_CLTHROWA(CL_ERR_IO,"Lock obtain timed out");
20
_LUCENE_SLEEP(LOCK_POLL_INTERVAL);