Synchronize datastore apis
Synchronize datastore apis

Currently there are 3 distinct operations performed by
datastore
   - Pushing the data to the store
   - Updating the Index of the local object
   - Updating the cache (in case of localscope)

Without a lock racing datastore api calls can interleave
in various surprising ways. Best thing is to keep these
3 above operation inseparable. Use a datastore lock to
achieve this.

Signed-off-by: Jana Radhakrishnan <045898bda7d4800fe4909a9831e702ab79e266be@docker.com>

abhi/libnetwork,mahak/libnetwork,sainath14/libnetwork,medallia/libnetwork,aboch/libnetwork_new,ityangchen/libnetwork,msabansal/libnetwork,mavenugo/libnetwork,YujiOshima/libnetwork,AdoHe/libnetwork,msabansal/libnetwork,vdemeester/libnetwork,abhi/libnetwork,WeiZhang555/libnetwork,WeiZhang555/libnetwork,amitkris/libnetwork,aboch/libnetwork_new,mahak/libnetwork,docker/libnetwork,kunalkushwaha/libnetwork,ityangchen/libnetwork,kolyshkin/libnetwork,abhi/libnetwork,hackersdotmu/libnetwork,fcrisciani/libnetwork,mahak/libnetwork,anortef/libnetwork,kolyshkin/libnetwork,tgraf/libnetwork,pyakpyak/libnetwork,kunalkushwaha/libnetwork,tmakita/libnetwork,tmakita/libnetwork,coolljt0725/libnetwork,AdoHe/libnetwork,mbanikazemi/libnetwork,jmzwcn/libnetwork,allencloud/libnetwork,anortef/libnetwork,vdemeester/libnetwork,jimmycmh/libnetwork,cpuguy83/libnetwork,sainath14/libnetwork,amitkris/libnetwork,vdemeester/libnetwork,mavenugo/libnetwork,jimmycmh/libnetwork,medallia/libnetwork,cpuguy83/libnetwork,docker/libnetwork,coolljt0725/libnetwork,junxu/libnetwork,kolyshkin/libnetwork,jmzwcn/libnetwork,mYmNeo/libnetwork,mbanikazemi/libnetwork,runcom/libnetwork,mYmNeo/libnetwork,YujiOshima/libnetwork,tgraf/libnetwork,fcrisciani/libnetwork,medallia/libnetwork,curtiszimmerman/libnetwork,runcom/libnetwork,pyakpyak/libnetwork,allencloud/libnetwork,hackersdotmu/libnetwork,junxu/libnetwork,curtiszimmerman/libnetwork,docker/libnetwork