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
35ddd0d0
authored
9 years ago
by
Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: changed group deleted attribute to atomic
parent
d06a82f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
mtapi_c/src/embb_mtapi_group_t.c
+4
-4
mtapi_c/src/embb_mtapi_group_t.h
+1
-1
No files found.
mtapi_c/src/embb_mtapi_group_t.c
View file @
35ddd0d0
...
...
@@ -55,7 +55,7 @@ void embb_mtapi_group_initialize(embb_mtapi_group_t * that) {
assert
(
MTAPI_NULL
!=
that
);
that
->
group_id
=
MTAPI_GROUP_ID_NONE
;
that
->
deleted
=
MTAPI_FALSE
;
embb_atomic_store_int
(
&
that
->
deleted
,
MTAPI_FALSE
)
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_initialize
(
&
that
->
queue
);
}
...
...
@@ -67,7 +67,7 @@ void embb_mtapi_group_initialize_with_node(
assert
(
MTAPI_NULL
!=
node
);
that
->
group_id
=
MTAPI_GROUP_ID_NONE
;
that
->
deleted
=
MTAPI_FALSE
;
embb_atomic_store_int
(
&
that
->
deleted
,
MTAPI_FALSE
)
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_initialize_with_capacity
(
&
that
->
queue
,
node
->
attributes
.
queue_limit
);
...
...
@@ -76,7 +76,7 @@ void embb_mtapi_group_initialize_with_node(
void
embb_mtapi_group_finalize
(
embb_mtapi_group_t
*
that
)
{
assert
(
MTAPI_NULL
!=
that
);
that
->
deleted
=
MTAPI_TRUE
;
embb_atomic_store_int
(
&
that
->
deleted
,
MTAPI_TRUE
)
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_finalize
(
&
that
->
queue
);
}
...
...
@@ -372,7 +372,7 @@ void mtapi_group_delete(
embb_mtapi_group_pool_get_storage_for_handle
(
node
->
group_pool
,
group
);
if
(
local_group
->
deleted
)
{
if
(
embb_atomic_load_int
(
&
local_group
->
deleted
)
)
{
local_status
=
MTAPI_ERR_GROUP_INVALID
;
}
else
{
embb_mtapi_group_finalize
(
local_group
);
...
...
This diff is collapsed.
Click to expand it.
mtapi_c/src/embb_mtapi_group_t.h
View file @
35ddd0d0
...
...
@@ -55,7 +55,7 @@ struct embb_mtapi_group_struct {
mtapi_group_hndl_t
handle
;
mtapi_group_id_t
group_id
;
volatile
mtapi_boolean_
t
deleted
;
embb_atomic_in
t
deleted
;
embb_atomic_int
num_tasks
;
mtapi_group_attributes_t
attributes
;
embb_mtapi_task_queue_t
queue
;
...
...
This diff is collapsed.
Click to expand it.
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