forked from niklasso/minisat
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from conp-solutions/parallel-proofs
Parallel proofs
- Loading branch information
Showing
17 changed files
with
680 additions
and
126 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*************************************************************************************[LockGuard.h] | ||
Copyright (c) 2022, Norbert Manthey | ||
**************************************************************************************************/ | ||
|
||
#ifndef LockGuard_h | ||
#define LockGuard_h | ||
|
||
#include "mtl/XAlloc.h" | ||
#include <mutex> | ||
|
||
namespace MERGESAT_NSPACE | ||
{ | ||
|
||
/** Allow to easily grab a lock for the life time of a function or code block.*/ | ||
class LockGuard | ||
{ | ||
std::mutex &lock; | ||
bool doUnlock; | ||
|
||
public: | ||
LockGuard(std::mutex &externLock, bool doLock) : lock(externLock), doUnlock(doLock) | ||
{ | ||
if (doLock) lock.lock(); | ||
} | ||
~LockGuard() | ||
{ | ||
if (doUnlock) lock.unlock(); | ||
} | ||
}; | ||
|
||
} // namespace MERGESAT_NSPACE | ||
|
||
#endif |
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.