The problem with this function:
xtPublic void xt_ind_release_handle(XTIndHandlePtr handle, xtBool have_lock, XTThreadPtr thread)
is that 'thread' is not used if atomic ops are not used(i.e. if the global XT_NO_ATOMICS is defined).
In cache_xt.cc, we see:
#ifdef XT_NO_ATOMICS #define IDX_CAC_USE_PTHREAD_RW #else //#define IDX_CAC_USE_PTHREAD_RW #define IDX_CAC_USE_XSMUTEX //#define IDX_USE_SPINXSLOCK #endif
#if defined(IDX_CAC_USE_PTHREAD_RW) #define IDX_CAC_LOCK_TYPE xt_rwlock_type #define IDX_CAC_INIT_LOCK(s, i) xt_init_rwlock_with_autoname(s, &(i)->cs_lock) #define IDX_CAC_FREE_LOCK(s, i) xt_free_rwlock(&(i)->cs_lock) #define IDX_CAC_READ_LOCK(i, o) xt_slock_rwlock_ns(&(i)->cs_lock) #define IDX_CAC_WRITE_LOCK(i, o) xt_xlock_rwlock_ns(&(i)->cs_lock) #define IDX_CAC_UNLOCK(i, o) xt_unlock_rwlock_ns(&(i)->cs_lock) #elif defined(IDX_CAC_USE_XSMUTEX) ....
So the macro IDX_CAC_READ_LOCK(i, o) ignores the thread parameter (o) in the case of XT_NO_ATOMICS.
So the solution may be as follows:
#define IDX_CAC_READ_LOCK(i, o) xt_slock_rwlock_ns(&(i)->cs_lock); (void) (o);
or even better:
#define IDX_CAC_READ_LOCK(i, o) do { xt_slock_rwlock_ns(&(i)->cs_lock); (void) (o); } where (0)
This should also solve the second warning: plugin/pbxt/src/cache_xt.cc:829: error: unused parameter ‘ot’
The problem with this function:
xtPublic void xt_ind_ release_ handle( XTIndHandlePtr handle, xtBool have_lock, XTThreadPtr thread)
is that 'thread' is not used if atomic ops are not used(i.e. if the global XT_NO_ATOMICS is defined).
In cache_xt.cc, we see:
#ifdef XT_NO_ATOMICS USE_PTHREAD_ RW USE_PTHREAD_ RW
#define IDX_CAC_
#else
//#define IDX_CAC_
#define IDX_CAC_USE_XSMUTEX
//#define IDX_USE_SPINXSLOCK
#endif
#if defined( IDX_CAC_ USE_PTHREAD_ RW) INIT_LOCK( s, i) xt_init_ rwlock_ with_autoname( s, &(i)->cs_lock) FREE_LOCK( s, i) xt_free_ rwlock( &(i)->cs_ lock) READ_LOCK( i, o) xt_slock_ rwlock_ ns(&(i) ->cs_lock) WRITE_LOCK( i, o) xt_xlock_ rwlock_ ns(&(i) ->cs_lock) rwlock_ ns(&(i) ->cs_lock) IDX_CAC_ USE_XSMUTEX)
#define IDX_CAC_LOCK_TYPE xt_rwlock_type
#define IDX_CAC_
#define IDX_CAC_
#define IDX_CAC_
#define IDX_CAC_
#define IDX_CAC_UNLOCK(i, o) xt_unlock_
#elif defined(
....
So the macro IDX_CAC_ READ_LOCK( i, o) ignores the thread parameter (o) in the case of XT_NO_ATOMICS.
So the solution may be as follows:
#define IDX_CAC_ READ_LOCK( i, o) xt_slock_ rwlock_ ns(&(i) ->cs_lock) ; (void) (o);
or even better:
#define IDX_CAC_ READ_LOCK( i, o) do { xt_slock_ rwlock_ ns(&(i) ->cs_lock) ; (void) (o); } where (0)
This should also solve the second warning: plugin/ pbxt/src/ cache_xt. cc:829: error: unused parameter ‘ot’