use try_to_lock
add missed headers to lock
add clang to travis
Revert "add clang to travis"

This reverts commit 7c1e3ab56db5d7bd19b6978d2ef917409d86223f.
Revert "add missed headers to lock"

This reverts commit 0cd362377df70a2c45d8941e019e6cdc13e9bc0a.
Fix build with gcc46
use thread_local mapblock cache
Merge remote-tracking branch 'upstream/master' into next