Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iriutils
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
iriutils
Commits
2a0095f2
Commit
2a0095f2
authored
11 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Added a function to get the status of the thread.
parent
3fc4a19c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/threads/threadserver.cpp
+18
-0
18 additions, 0 deletions
src/threads/threadserver.cpp
src/threads/threadserver.h
+6
-0
6 additions, 0 deletions
src/threads/threadserver.h
with
24 additions
and
0 deletions
src/threads/threadserver.cpp
+
18
−
0
View file @
2a0095f2
...
@@ -195,3 +195,21 @@ void CThreadServer::detach_thread(const std::string& thread_id)
...
@@ -195,3 +195,21 @@ void CThreadServer::detach_thread(const std::string& thread_id)
thread
->
detach
();
thread
->
detach
();
}
}
}
}
int
CThreadServer
::
get_thread_state
(
const
std
::
string
&
thread_id
)
{
std
::
list
<
CThread
>::
iterator
thread
;
this
->
access_threads
.
enter
();
if
((
thread
=
this
->
search_thread
(
thread_id
))
==
(
std
::
list
<
CThread
>::
iterator
)
NULL
)
{
this
->
access_threads
.
exit
();
/* handle exceptions */
throw
CThreadServerException
(
_HERE_
,
"Unknown thread"
,
thread_id
);
}
else
{
this
->
access_threads
.
exit
();
return
thread
->
get_state
();
}
}
This diff is collapsed.
Click to expand it.
src/threads/threadserver.h
+
6
−
0
View file @
2a0095f2
...
@@ -314,6 +314,12 @@ class CThreadServer
...
@@ -314,6 +314,12 @@ class CThreadServer
* must not have any spaces or special characters, and must be unique.
* must not have any spaces or special characters, and must be unique.
*/
*/
void
detach_thread
(
const
std
::
string
&
thread_id
);
void
detach_thread
(
const
std
::
string
&
thread_id
);
/**
* \brief
*
*/
int
get_thread_state
(
const
std
::
string
&
thread_id
);
};
};
#endif
#endif
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