Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
b238fcf4
Commit
b238fcf4
authored
11 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[common.crtp] make it threadsafe
* according to Rene
parent
fa09266c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/stuff/common/crtp.hh
+5
-4
5 additions, 4 deletions
dune/stuff/common/crtp.hh
with
5 additions
and
4 deletions
dune/stuff/common/crtp.hh
+
5
−
4
View file @
b238fcf4
...
...
@@ -6,8 +6,9 @@
#ifndef DUNE_STUFF_COMMON_CRTP_HH
#define DUNE_STUFF_COMMON_CRTP_HH
#include
<atomic>
#include
"exceptions.hh"
#include
<dune/common/bartonnackmanifcheck.hh>
#ifdef CHECK_CRTP
#undef CHECK_CRTP
...
...
@@ -20,14 +21,14 @@
#define CHECK_CRTP(dummy)
#else
/**
* This macro is essentially a
slightly modified copy
of the CHECK_INTERFACE_IMPLEMENTATION macro.
* This macro is essentially a
thread safe variant
of the CHECK_INTERFACE_IMPLEMENTATION macro
from dune-common
.
*/
#define CHECK_CRTP(__interface_method_to_call__) \
{ \
static bool call
=
false;
\
static
std::atomic<
bool
>
call
(
false
)
; \
if (call) \
DUNE_THROW_COLORFULLY(Dune::Stuff::Exception::CRTP_check_failed, \
"The derived class does not implement
a
required method!");
\
"The derived class does not implement
the
required method!"); \
call = true; \
try { \
(__interface_method_to_call__); \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment