Merge remote-tracking branch 'couchbase/3.0.x' into sherlock 80/64980/2
authorDave Rigby <daver@couchbase.com>
Thu, 16 Jun 2016 16:01:14 +0000 (17:01 +0100)
committerDave Rigby <daver@couchbase.com>
Thu, 16 Jun 2016 16:59:38 +0000 (17:59 +0100)
* couchbase/3.0.x:
  MB-19223: Switch to hrtime from timeval in Global Thread Pool
  MB-19222: Fix race condition in TaskQueue shutdown
  MB-19220: Ensure HashTable::size is atomic

Change-Id: I6e36e57c8394bb0eb147c697a81d0cbeeae423f7

1  2 
src/executorpool.cc
src/executorthread.cc
src/executorthread.h
src/taskqueue.cc
src/taskqueue.h
src/tasks.cc
src/tasks.h

Simple merge
Simple merge
@@@ -64,8 -64,7 +64,8 @@@ public
            state(EXECUTOR_CREATING), taskStart(0),
            currentTask(NULL), curTaskType(NO_TASK_TYPE),
            tasklog(TASK_LOG_SIZE), slowjobs(TASK_LOG_SIZE) {
-               gettimeofday(&now, NULL);
-               set_max_tv(waketime);
++              now = gethrtime();
+               waketime = hrtime_t(-1);
      }
  
      ~ExecutorThread() {
Simple merge
diff --cc src/taskqueue.h
@@@ -51,15 -51,9 +51,15 @@@ public
  
      const task_type_t getQueueType() const { return queueType; }
  
 +    size_t getReadyQueueSize();
 +
 +    size_t getFutureQueueSize();
 +
 +    size_t getPendingQueueSize();
 +
  private:
      void _schedule(ExTask &task);
-     struct timeval _reschedule(ExTask &task, task_type_t &curTaskType);
+     hrtime_t _reschedule(ExTask &task, task_type_t &curTaskType);
      void _checkPendingQueue(void);
      bool _fetchNextTask(ExecutorThread &thread, bool toSleep);
      void _wake(ExTask &task);
diff --cc src/tasks.cc
Simple merge
diff --cc src/tasks.h
Simple merge