src/db/version_set.h
// Returns the index of the thread which is idle. Returns -1 if no thread is idle.
Returns the index of the thread which is idle. Returns -1 if no thread is idle.
Returns the index of the thread which is idle . Returns - 1 if no thread is idle .
int GetIdleThreadIndex(pthread_t current_thread) {
	  int index = -1;
	  seek_mutex_.Lock();
	  for (int i = 0; i < NUM_SEEK_THREADS; i++) {
		  if (seek_threads_current_workload[i] == 0) {
			  seek_threads_current_workload[i] = current_thread;
			  index = i;
			  break;
		  }
	  }
	  seek_mutex_.Unlock();
	  return index;
  }
int GetIdleThreadIndex ( pthread_t current_thread ) { int index = -1 ; seek_mutex_ . Lock ( ) ; for ( int i = 0 ; i < NUM_SEEK_THREADS ; i ++ ) { if ( seek_threads_current_workload [ i ] == 0 ) { seek_threads_current_workload [ i ] = current_thread ; index = i ; break ; } } seek_mutex_ . Unlock ( ) ; return index ; }
Returns the index of the thread which is idle.
Returns the index of the thread which is idle .