-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synchronize around prepared->Execute and around calls
- Loading branch information
Showing
12 changed files
with
97 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <mutex> | ||
|
||
namespace quack { | ||
|
||
struct Logger { | ||
public: | ||
static std::mutex &GetLock() { | ||
static std::mutex lock; | ||
return lock; | ||
} | ||
}; | ||
|
||
} // namespace quack | ||
|
||
extern "C" { | ||
#include "postgres.h" | ||
}; | ||
|
||
#define elog_quack(elevel, ...) \ | ||
quack::Logger::GetLock().lock(); \ | ||
PG_TRY(); \ | ||
{ \ | ||
ereport(elevel, errmsg_internal(__VA_ARGS__)); \ | ||
} \ | ||
PG_CATCH(); \ | ||
{ \ | ||
quack::Logger::GetLock().unlock(); \ | ||
PG_RE_THROW(); \ | ||
} \ | ||
quack::Logger::GetLock().unlock(); \ | ||
PG_END_TRY(); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.