Address data race while printing ep_access_scannner_task_time
Address data race while printing ep_access_scannner_task_time

WARNING: ThreadSanitizer: data race (pid=7679)

  Read of size 8 at 0x7d780000f778 by main thread (mutexes: write M31817041):
    #0 gmtime_r <null>:0 (engine_testapp+0x00000006235e)
    #1 cb_gmtime_r /home/abhinav/couchbase/platform/src/cb_time.c:92 (libplatform.so.0.1.0+0x0000000063de)
    #2 EventuallyPersistentEngine::doEngineStats(void const*, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:3528 (ep.so+0x0000000bde17)
    #3 EventuallyPersistentEngine::getStats(void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:4555 (ep.so+0x0000000c531c)
    #4 EvpGetStats(engine_interface*, void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:213 (ep.so+0x0000000b441e)
    #5 mock_get_stats(engine_interface*, void const*, char const*, int, void (*)(char const*, unsigned short, char const*, unsigned int, void const*)) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:239 (engine_testapp+0x0000000ba9ad)
    #6 get_int_stat(engine_interface*, engine_interface_v1*, char const*, char const*) /home/abhinav/couchbase/ep-engine/tests/ep_test_apis.cc:990 (ep_testsuite.so+0x0000000aeb81)
    #7 wait_for_stat_to_be(engine_interface*, engine_interface_v1*, char const*, int, char const*, long) /home/abhinav/couchbase/ep-engine/tests/ep_test_apis.cc:1120 (ep_testsuite.so+0x0000000b5093)
    #8 test_access_scanner(engine_interface*, engine_interface_v1*) /home/abhinav/couchbase/ep-engine/tests/ep_testsuite.cc:8591 (ep_testsuite.so+0x00000002f4f0)
    #9 execute_test(test, char const*, char const*) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:1090 (engine_testapp+0x0000000b946c)
    #10 __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287 (libc.so.6+0x000000021ec4)

  Previous atomic write of size 8 at 0x7d780000f778 by thread T9:
    #0 __tsan_atomic64_store <null>:0 (engine_testapp+0x00000009b837)
    #1 std::__atomic_base<unsigned long>::store(unsigned long, std::memory_order) /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/atomic_base.h:474 (ep.so+0x0000000199a8)
    #2 ExecutorThread::run() /home/abhinav/couchbase/ep-engine/src/executorthread.cc:112 (ep.so+0x0000000f89c6)
    #3 launch_executor_thread(void*) /home/abhinav/couchbase/ep-engine/src/executorthread.cc:33 (ep.so+0x0000000f8565)
    #4 platform_thread_wrap /home/abhinav/couchbase/platform/src/cb_pthreads.c:23 (libplatform.so.0.1.0+0x000000003d31)

Change-Id: I076daf1df26164da3038cdd4dfd7ad405104dfc7
Reviewed-on: http://review.couchbase.org/55790
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>

owendCB/ep-engine,daverigby/ep-engine,hisundar/ep-engine,daverigby/kv_engine,hisundar/ep-engine,teligent-ru/ep-engine,couchbase/ep-engine,owendCB/ep-engine,daverigby/kv_engine,teligent-ru/ep-engine,couchbase/ep-engine,teligent-ru/ep-engine,owendCB/ep-engine,couchbase/ep-engine,membase/ep-engine,daverigby/kv_engine,daverigby/ep-engine,daverigby/kv_engine,couchbase/ep-engine,teligent-ru/ep-engine,owendCB/ep-engine,daverigby/ep-engine,hisundar/ep-engine,daverigby/ep-engine,membase/ep-engine,membase/ep-engine,hisundar/ep-engine,membase/ep-engine