Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
PolyORB-HI-C
Commits
b8c1ed12
Commit
b8c1ed12
authored
Jun 18, 2016
by
yoogx
Browse files
* __po_hi_task_id __po_hi_get_task_id (void): new function
that returns the id of the current task
parent
fe0fefe2
Pipeline
#351
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/po_hi_task.h
View file @
b8c1ed12
...
...
@@ -112,6 +112,11 @@ typedef size_t __po_hi_stack_t;
*/
int
__po_hi_initialize_tasking
(
void
);
/*
* Get the id of a task
*/
__po_hi_task_id
__po_hi_get_task_id
(
void
);
/*
* Create a periodic task.
*
...
...
src/po_hi_task.c
View file @
b8c1ed12
...
...
@@ -109,6 +109,21 @@ __po_hi_task_t tasks[__PO_HI_NB_TASKS];
HANDLE
__po_hi_tasks_array
[
__PO_HI_NB_TASKS
];
#endif
__po_hi_task_id
__po_hi_get_task_id
(
void
)
{
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX)
pthread_t
pthread_id
=
pthread_self
();
for
(
int
i
=
0
;
i
<
__PO_HI_NB_TASKS
;
i
++
)
{
if
(
pthread_id
==
tasks
[
i
].
tid
)
{
return
tasks
[
i
].
id
;
}
}
#endif
return
(
__PO_HI_ERROR_UNKNOWN
);
}
void
__po_hi_wait_for_tasks
()
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment