diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-29 23:55:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-30 23:57:17 +0300 |
commit | 8f3d3956b1e837c726859eb8bbe19dad79c54a42 (patch) | |
tree | 81ded52db212b12c7f685165702cce90aa0233cf /brep/database-lock | |
parent | ea60a6df471706a0eeb5ff1f774d69abe89e4bc9 (diff) |
Add hxx extension for headers and lib prefix for library dirs
Diffstat (limited to 'brep/database-lock')
-rw-r--r-- | brep/database-lock | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/brep/database-lock b/brep/database-lock deleted file mode 100644 index 6bf21c9..0000000 --- a/brep/database-lock +++ /dev/null @@ -1,43 +0,0 @@ -// file : brep/database-lock -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BREP_DATABASE_LOCK -#define BREP_DATABASE_LOCK - -#include <odb/pgsql/forward.hxx> // database, transaction -#include <odb/pgsql/connection.hxx> - -#include <brep/types> -#include <brep/utility> - -namespace brep -{ - struct database_locked: std::exception - { - virtual char const* - what () const throw () {return "database locked";} - }; - - // Try to "lock" the PostgreSQL database in the constructor and release the - // lock in the destructor. Throw database_locked if the database is already - // locked by someone else. May also throw odb::pgsql::database_exception. - // - // This mechanism is used by the brep loader and schema migration tool to - // make sure they don't step on each others toes. - // - // Note: movable but not copyable. - // - class database_lock - { - public: - explicit - database_lock (odb::pgsql::database&); - - private: - odb::pgsql::connection_ptr connection_; - unique_ptr<odb::pgsql::transaction> transaction_; - }; -} - -#endif // BREP_DATABASE_LOCK |