Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
679c1bd4
authored
Dec 19, 2014
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed cpplint warnings
parent
318574bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
mtapi_c/src/embb_mtapi_action_plugin_t.c
+7
-11
mtapi_c/src/embb_mtapi_task_t.c
+8
-4
mtapi_c/test/embb_mtapi_test_plugin.cc
+6
-3
No files found.
mtapi_c/src/embb_mtapi_action_plugin_t.c
View file @
679c1bd4
...
@@ -35,7 +35,8 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
...
@@ -35,7 +35,8 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
MTAPI_IN
mtapi_job_id_t
job_id
,
MTAPI_IN
mtapi_job_id_t
job_id
,
MTAPI_IN
mtapi_ext_plugin_task_start_function_t
task_start_function
,
MTAPI_IN
mtapi_ext_plugin_task_start_function_t
task_start_function
,
MTAPI_IN
mtapi_ext_plugin_task_cancel_function_t
task_cancel_function
,
MTAPI_IN
mtapi_ext_plugin_task_cancel_function_t
task_cancel_function
,
MTAPI_IN
mtapi_ext_plugin_action_finalize_function_t
action_finalize_function
,
MTAPI_IN
mtapi_ext_plugin_action_finalize_function_t
action_finalize_function
,
MTAPI_IN
void
*
plugin_data
,
MTAPI_IN
void
*
plugin_data
,
MTAPI_IN
void
*
node_local_data
,
MTAPI_IN
void
*
node_local_data
,
MTAPI_IN
mtapi_size_t
node_local_data_size
,
MTAPI_IN
mtapi_size_t
node_local_data_size
,
...
@@ -72,8 +73,7 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
...
@@ -72,8 +73,7 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
if
(
MTAPI_NULL
!=
attributes
)
{
if
(
MTAPI_NULL
!=
attributes
)
{
new_action
->
attributes
=
*
attributes
;
new_action
->
attributes
=
*
attributes
;
local_status
=
MTAPI_SUCCESS
;
local_status
=
MTAPI_SUCCESS
;
}
}
else
{
else
{
/* use the default */
/* use the default */
mtapi_actionattr_init
(
&
new_action
->
attributes
,
&
local_status
);
mtapi_actionattr_init
(
&
new_action
->
attributes
,
&
local_status
);
}
}
...
@@ -86,21 +86,17 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
...
@@ -86,21 +86,17 @@ mtapi_action_hndl_t mtapi_ext_plugin_action_create(
if
(
MTAPI_SUCCESS
==
local_status
)
{
if
(
MTAPI_SUCCESS
==
local_status
)
{
action_handle
=
new_action
->
handle
;
action_handle
=
new_action
->
handle
;
embb_mtapi_job_add_action
(
job
,
new_action
);
embb_mtapi_job_add_action
(
job
,
new_action
);
}
}
else
{
else
{
embb_mtapi_action_pool_deallocate
(
node
->
action_pool
,
new_action
);
embb_mtapi_action_pool_deallocate
(
node
->
action_pool
,
new_action
);
}
}
}
}
else
{
else
{
/* no more space left in action pool */
/* no more space left in action pool */
local_status
=
MTAPI_ERR_ACTION_LIMIT
;
local_status
=
MTAPI_ERR_ACTION_LIMIT
;
}
}
}
}
else
{
else
{
local_status
=
MTAPI_ERR_JOB_INVALID
;
local_status
=
MTAPI_ERR_JOB_INVALID
;
}
}
}
}
else
{
else
{
embb_mtapi_log_error
(
"mtapi not initialized
\n
"
);
embb_mtapi_log_error
(
"mtapi not initialized
\n
"
);
local_status
=
MTAPI_ERR_NODE_NOTINIT
;
local_status
=
MTAPI_ERR_NODE_NOTINIT
;
}
}
...
...
mtapi_c/src/embb_mtapi_task_t.c
View file @
679c1bd4
...
@@ -239,8 +239,10 @@ static mtapi_task_hndl_t embb_mtapi_task_start(
...
@@ -239,8 +239,10 @@ static mtapi_task_hndl_t embb_mtapi_task_start(
if
(
local_action
->
is_plugin_action
)
{
if
(
local_action
->
is_plugin_action
)
{
/* schedule plugin task */
/* schedule plugin task */
mtapi_status_t
plugin_status
=
MTAPI_ERR_UNKNOWN
;
mtapi_status_t
plugin_status
=
MTAPI_ERR_UNKNOWN
;
local_action
->
plugin_task_start_function
(
task_hndl
,
&
plugin_status
);
local_action
->
plugin_task_start_function
(
was_scheduled
=
(
MTAPI_SUCCESS
==
plugin_status
)
?
MTAPI_TRUE
:
MTAPI_FALSE
;
task_hndl
,
&
plugin_status
);
was_scheduled
=
(
MTAPI_SUCCESS
==
plugin_status
)
?
MTAPI_TRUE
:
MTAPI_FALSE
;
}
else
{
}
else
{
/* schedule local task */
/* schedule local task */
was_scheduled
=
was_scheduled
=
...
@@ -465,9 +467,11 @@ void mtapi_task_cancel(
...
@@ -465,9 +467,11 @@ void mtapi_task_cancel(
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_CANCELLED
);
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_CANCELLED
);
/* call plugin action cancel function */
/* call plugin action cancel function */
if
(
embb_mtapi_action_pool_is_handle_valid
(
node
->
action_pool
,
local_task
->
action
))
{
if
(
embb_mtapi_action_pool_is_handle_valid
(
node
->
action_pool
,
local_task
->
action
))
{
embb_mtapi_action_t
*
local_action
=
embb_mtapi_action_t
*
local_action
=
embb_mtapi_action_pool_get_storage_for_handle
(
node
->
action_pool
,
local_task
->
action
);
embb_mtapi_action_pool_get_storage_for_handle
(
node
->
action_pool
,
local_task
->
action
);
if
(
local_action
->
is_plugin_action
)
{
if
(
local_action
->
is_plugin_action
)
{
local_action
->
plugin_task_cancel_function
(
task
,
&
local_status
);
local_action
->
plugin_task_cancel_function
(
task
,
&
local_status
);
}
}
...
...
mtapi_c/test/embb_mtapi_test_plugin.cc
View file @
679c1bd4
...
@@ -47,16 +47,19 @@ int plugin_thread_function(void * args) {
...
@@ -47,16 +47,19 @@ int plugin_thread_function(void * args) {
EMBB_UNUSED
(
args
);
EMBB_UNUSED
(
args
);
while
(
embb_atomic_load_int
(
&
plugin_running
))
{
while
(
embb_atomic_load_int
(
&
plugin_running
))
{
/* wait for incoming task */
/* wait for incoming task */
while
(
embb_atomic_load_int
(
&
plugin_running
)
&&
!
embb_atomic_load_int
(
&
plugin_task_available
))
while
(
embb_atomic_load_int
(
&
plugin_running
)
&&
!
embb_atomic_load_int
(
&
plugin_task_available
))
embb_thread_yield
();
embb_thread_yield
();
if
(
embb_atomic_load_int
(
&
plugin_running
))
{
if
(
embb_atomic_load_int
(
&
plugin_running
))
{
if
(
embb_mtapi_node_is_initialized
())
{
if
(
embb_mtapi_node_is_initialized
())
{
embb_mtapi_node_t
*
node
=
embb_mtapi_node_get_instance
();
embb_mtapi_node_t
*
node
=
embb_mtapi_node_get_instance
();
if
(
embb_mtapi_task_pool_is_handle_valid
(
node
->
task_pool
,
plugin_task
))
{
if
(
embb_mtapi_task_pool_is_handle_valid
(
node
->
task_pool
,
plugin_task
))
{
embb_mtapi_task_t
*
local_task
=
embb_mtapi_task_t
*
local_task
=
embb_mtapi_task_pool_get_storage_for_handle
(
node
->
task_pool
,
plugin_task
);
embb_mtapi_task_pool_get_storage_for_handle
(
node
->
task_pool
,
plugin_task
);
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_COMPLETED
);
embb_mtapi_task_set_state
(
local_task
,
MTAPI_TASK_COMPLETED
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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