Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Fischer
emper
Commits
bbb37ae9
Commit
bbb37ae9
authored
7 years ago
by
Florian Schmaus
Browse files
Options
Downloads
Patches
Plain Diff
Runtime: Use currentRuntime instead of lastRuntime
parent
ddde4e11
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
emper/Runtime.cpp
+3
-7
3 additions, 7 deletions
emper/Runtime.cpp
emper/Runtime.hpp
+5
-2
5 additions, 2 deletions
emper/Runtime.hpp
with
8 additions
and
9 deletions
emper/Runtime.cpp
+
3
−
7
View file @
bbb37ae9
...
...
@@ -16,7 +16,6 @@
std
::
mutex
Runtime
::
currentRuntimeMutex
;
Runtime
*
Runtime
::
currentRuntime
;
Runtime
*
Runtime
::
lastRuntime
;
thread_local
unsigned
int
Runtime
::
seed
;
thread_local
workerid_t
Runtime
::
workerId
;
RuntimeStrategy
&
Runtime
::
DEFAULT_STRATEGY
=
WsStrategy
::
INSTANCE
;
...
...
@@ -38,7 +37,7 @@ Runtime::Runtime(workerid_t workerCount, RuntimeStrategy& strategy) : workerCoun
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
currentRuntimeMutex
);
if
(
currentRuntime
!=
nullptr
)
{
exit
(
EXIT_FAILURE
);
DIE_MSG
(
"There is already a runtime active"
);
}
currentRuntime
=
this
;
}
...
...
@@ -66,7 +65,6 @@ Runtime::Runtime(workerid_t workerCount, RuntimeStrategy& strategy) : workerCoun
}
#ifdef EMPER_STATS
lastRuntime
=
this
;
int
res
=
std
::
atexit
(
&
printLastRuntimeStats
);
if
(
res
)
{
DIE_MSG
(
"could not register printStats() with at_exit()"
);
...
...
@@ -128,9 +126,7 @@ void Runtime::printStats() {
}
void
Runtime
::
printLastRuntimeStats
()
{
if
(
!
lastRuntime
)
DIE_MSG
(
"lastRuntime not set when invoking pinrtLastRuntimeStats"
);
lastRuntime
->
printStats
();
assert
(
currentRuntime
);
currentRuntime
->
printStats
();
}
This diff is collapsed.
Click to expand it.
emper/Runtime.hpp
+
5
−
2
View file @
bbb37ae9
...
...
@@ -42,7 +42,6 @@ private:
static
RuntimeStrategy
&
DEFAULT_STRATEGY
;
static
Runtime
*
lastRuntime
;
static
void
printLastRuntimeStats
();
protected:
...
...
@@ -105,7 +104,11 @@ public:
inline
ContextManager
&
getContextManager
()
{
return
contextManager
;
}
inline
RuntimeStrategy
&
getStrategy
()
{
return
strategy
;
}
void
waitUntilFinished
();
void
printStats
();
...
...
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