Address possible data race with loggerApi
Address possible data race with loggerApi

WARNING: ThreadSanitizer: data race (pid=16718)

  Write of size 8 at 0x7f6a616aad60 by main thread:
    #0 create_instance /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:1809:9 (ep.so+0x0000000b2c9c)
    #1 create_engine_instance /home/abhinav/couchbase/memcached/utilities/engine_loader.c:121:31 (libmcd_util.so.1.0.0+0x0000000056fd)
    #2 create_bucket(bool, char const*) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:924:9 (engine_testapp+0x0000000b99ed)
    #3 create_buckets(char const*, int, std::vector<BucketHolder, std::allocator<BucketHolder> >&) /home/abhinav/couchbase/ep-engine/tests/ep_testsuite_common.cc:316:36 (ep_testsuite.so+0x0000000ab215)
    #4 test_multi_bucket_set_get(test*) /home/abhinav/couchbase/ep-engine/tests/ep_testsuite.cc:14174:9 (ep_testsuite.so+0x000000093011)
    #5 execute_test(test, char const*, char const*) /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:1103:19 (engine_testapp+0x0000000b937d)
    #6 main /home/abhinav/couchbase/memcached/programs/engine_testapp/engine_testapp.cc:1439 (engine_testapp+0x0000000b937d)

  Previous read of size 8 at 0x7f6a616aad60 by thread T2 (mutexes: write M11526, write M11540):
    #0 LOG(EXTENSION_LOG_LEVEL, char const*, ...) /home/abhinav/couchbase/ep-engine/src/ep_engine.cc:1916:9 (ep.so+0x0000000b2eb4)
    #1 TaskQueue::_schedule(SingleThreadedRCPtr<GlobalTask>&) /home/abhinav/couchbase/ep-engine/src/taskqueue.cc:225:5 (ep.so+0x000000141957)
    #2 TaskQueue::schedule(SingleThreadedRCPtr<GlobalTask>&) /home/abhinav/couchbase/ep-engine/src/taskqueue.cc:239:5 (ep.so+0x000000141bde)
    #3 ExecutorPool::_schedule(SingleThreadedRCPtr<GlobalTask>, task_type_t) /home/abhinav/couchbase/ep-engine/src/executorpool.cc:430:5 (ep.so+0x0000000ef2f5)
    #4 ExecutorPool::schedule(SingleThreadedRCPtr<GlobalTask>, task_type_t) /home/abhinav/couchbase/ep-engine/src/executorpool.cc:437:17 (ep.so+0x0000000ef44f)
    #5 Warmup::scheduleEstimateDatabaseItemCount() /home/abhinav/couchbase/ep-engine/src/warmup.cc:538:9 (ep.so+0x000000158b7a)
    #6 Warmup::step() /home/abhinav/couchbase/ep-engine/src/warmup.cc:883:13 (ep.so+0x000000155510)
    #7 Warmup::transition(int, bool) /home/abhinav/couchbase/ep-engine/src/warmup.cc:920:9 (ep.so+0x00000015856e)
    #8 Warmup::createVBuckets(unsigned short) /home/abhinav/couchbase/ep-engine/src/warmup.cc:525 (ep.so+0x00000015856e)
    #9 WarmupCreateVBuckets::run() /home/abhinav/couchbase/ep-engine/src/warmup.h:249:9 (ep.so+0x000000165236)
    #10 ExecutorThread::run() /home/abhinav/couchbase/ep-engine/src/executorthread.cc:112:26 (ep.so+0x0000000f8296)
    #11 launch_executor_thread(void*) /home/abhinav/couchbase/ep-engine/src/executorthread.cc:33:9 (ep.so+0x0000000f7e35)
    #12 platform_thread_wrap /home/abhinav/couchbase/platform/src/cb_pthreads.c:23:5 (libplatform.so.0.1.0+0x000000003d31)

  Location is global 'loggerApi' of size 8 at 0x7f6a616aad60 (ep.so+0x00000042ad60)

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

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