Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
e9de85b1
Commit
e9de85b1
authored
7 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
make sure all threads are properly named
parent
385c4060
No related branches found
Branches containing commit
Tags
02.04.00
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/Application.h
+8
-1
8 additions, 1 deletion
include/Application.h
include/ThreadedFanOut.h
+2
-1
2 additions, 1 deletion
include/ThreadedFanOut.h
include/TriggerFanOut.h
+1
-0
1 addition, 0 deletions
include/TriggerFanOut.h
src/ApplicationModule.cc
+2
-0
2 additions, 0 deletions
src/ApplicationModule.cc
with
13 additions
and
2 deletions
include/Application.h
+
8
−
1
View file @
e9de85b1
...
...
@@ -79,7 +79,11 @@ namespace ChimeraTK {
*
* Note: Enabling the testable mode will have a singificant impact on the performance, since it will prevent
* any module threads to run at the same time! */
void
enableTestableMode
()
{
testableMode
=
true
;
testableModeLock
(
"enableTestableMode"
);
}
void
enableTestableMode
()
{
testableMode
=
true
;
testableModeLock
(
"enableTestableMode"
);
testableModeThreadName
()
=
"TEST THREAD"
;
}
/** Resume the application until all application threads are stuck in a blocking read operation. Works only when
* the testable mode was enabled. */
...
...
@@ -101,6 +105,7 @@ namespace ChimeraTK {
*
* This function should generally not be used in user code. */
static
void
testableModeLock
(
const
std
::
string
&
name
)
{
if
(
!
getInstance
().
testableMode
)
return
;
if
(
getInstance
().
enableDebugTestableMode
)
{
std
::
cout
<<
"Application::testableModeLock(): Thread "
<<
testableModeThreadName
()
<<
" tries to obtain lock for "
<<
name
<<
std
::
endl
;
...
...
@@ -119,6 +124,7 @@ namespace ChimeraTK {
*
* This function should generally not be used in user code. */
static
void
testableModeUnlock
(
const
std
::
string
&
name
)
{
if
(
!
getInstance
().
testableMode
)
return
;
if
(
getInstance
().
enableDebugTestableMode
)
{
std
::
cout
<<
"Application::testableModeUnlock(): Thread "
<<
testableModeThreadName
()
<<
" releases lock for "
<<
name
<<
std
::
endl
;
...
...
@@ -130,6 +136,7 @@ namespace ChimeraTK {
*
* This function should generally not be used in user code. */
static
bool
testableModeTestLock
()
{
if
(
!
getInstance
().
testableMode
)
return
false
;
return
getTestableModeLockObject
().
owns_lock
();
}
...
...
This diff is collapsed.
Click to expand it.
include/ThreadedFanOut.h
+
2
−
1
View file @
e9de85b1
...
...
@@ -47,7 +47,8 @@ namespace ChimeraTK {
/** Synchronise feeder and the consumers. This function is executed in the separate thread. */
void
run
()
{
Application
::
getInstance
().
testableModeThreadName
()
=
"Threaded "
+
FanOut
<
UserType
>::
impl
->
getName
();
Application
::
getInstance
().
testableModeThreadName
()
=
"ThreadedFanOut "
+
FanOut
<
UserType
>::
impl
->
getName
();
Application
::
testableModeLock
(
"start"
);
while
(
true
)
{
// receive data
boost
::
this_thread
::
interruption_point
();
...
...
This diff is collapsed.
Click to expand it.
include/TriggerFanOut.h
+
1
−
0
View file @
e9de85b1
...
...
@@ -59,6 +59,7 @@ namespace ChimeraTK {
/** Synchronise feeder and the consumers. This function is executed in the separate thread. */
void
run
()
{
Application
::
getInstance
().
testableModeThreadName
()
=
"TriggerFanOut "
+
externalTrigger
->
getName
();
Application
::
testableModeLock
(
"start"
);
while
(
true
)
{
// wait for external trigger
boost
::
this_thread
::
interruption_point
();
...
...
This diff is collapsed.
Click to expand it.
src/ApplicationModule.cc
+
2
−
0
View file @
e9de85b1
...
...
@@ -37,8 +37,10 @@ namespace ChimeraTK {
void
ApplicationModule
::
mainLoopWrapper
()
{
Application
::
getInstance
().
testableModeThreadName
()
=
"ApplicatioModule "
+
getName
();
Application
::
testableModeLock
(
"start"
);
// enter the main loop
mainLoop
();
Application
::
testableModeUnlock
(
"terminate"
);
}
/*********************************************************************************************************************/
...
...
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