diff options
Diffstat (limited to 'odb/details/lock.hxx')
-rw-r--r-- | odb/details/lock.hxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/odb/details/lock.hxx b/odb/details/lock.hxx index 26ab4a8..28f3ede 100644 --- a/odb/details/lock.hxx +++ b/odb/details/lock.hxx @@ -10,12 +10,23 @@ #include <odb/details/export.hxx> #include <odb/details/mutex.hxx> +#ifdef ODB_THREADS_CXX11 +# include <mutex> namespace odb { namespace details { - struct LIBODB_EXPORT lock + using lock = std::unique_lock<mutex>; + } +} +#else +namespace odb +{ + namespace details + { + class LIBODB_EXPORT lock { + public: lock (mutex& m) : mutex_ (&m) { @@ -43,6 +54,7 @@ namespace odb }; } } +#endif #include <odb/post.hxx> |