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
Jan 30, 2016
by
Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: changed group deleted attribute to atomic
parent
d06a82f0
Show 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) {
...
@@ -55,7 +55,7 @@ void embb_mtapi_group_initialize(embb_mtapi_group_t * that) {
assert
(
MTAPI_NULL
!=
that
);
assert
(
MTAPI_NULL
!=
that
);
that
->
group_id
=
MTAPI_GROUP_ID_NONE
;
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
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_initialize
(
&
that
->
queue
);
embb_mtapi_task_queue_initialize
(
&
that
->
queue
);
}
}
...
@@ -67,7 +67,7 @@ void embb_mtapi_group_initialize_with_node(
...
@@ -67,7 +67,7 @@ void embb_mtapi_group_initialize_with_node(
assert
(
MTAPI_NULL
!=
node
);
assert
(
MTAPI_NULL
!=
node
);
that
->
group_id
=
MTAPI_GROUP_ID_NONE
;
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
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_initialize_with_capacity
(
embb_mtapi_task_queue_initialize_with_capacity
(
&
that
->
queue
,
node
->
attributes
.
queue_limit
);
&
that
->
queue
,
node
->
attributes
.
queue_limit
);
...
@@ -76,7 +76,7 @@ void embb_mtapi_group_initialize_with_node(
...
@@ -76,7 +76,7 @@ void embb_mtapi_group_initialize_with_node(
void
embb_mtapi_group_finalize
(
embb_mtapi_group_t
*
that
)
{
void
embb_mtapi_group_finalize
(
embb_mtapi_group_t
*
that
)
{
assert
(
MTAPI_NULL
!=
that
);
assert
(
MTAPI_NULL
!=
that
);
that
->
deleted
=
MTAPI_TRUE
;
embb_atomic_store_int
(
&
that
->
deleted
,
MTAPI_TRUE
)
;
that
->
num_tasks
.
internal_variable
=
0
;
that
->
num_tasks
.
internal_variable
=
0
;
embb_mtapi_task_queue_finalize
(
&
that
->
queue
);
embb_mtapi_task_queue_finalize
(
&
that
->
queue
);
}
}
...
@@ -372,7 +372,7 @@ void mtapi_group_delete(
...
@@ -372,7 +372,7 @@ void mtapi_group_delete(
embb_mtapi_group_pool_get_storage_for_handle
(
embb_mtapi_group_pool_get_storage_for_handle
(
node
->
group_pool
,
group
);
node
->
group_pool
,
group
);
if
(
local_group
->
deleted
)
{
if
(
embb_atomic_load_int
(
&
local_group
->
deleted
)
)
{
local_status
=
MTAPI_ERR_GROUP_INVALID
;
local_status
=
MTAPI_ERR_GROUP_INVALID
;
}
else
{
}
else
{
embb_mtapi_group_finalize
(
local_group
);
embb_mtapi_group_finalize
(
local_group
);
...
...
mtapi_c/src/embb_mtapi_group_t.h
View file @
35ddd0d0
...
@@ -55,7 +55,7 @@ struct embb_mtapi_group_struct {
...
@@ -55,7 +55,7 @@ struct embb_mtapi_group_struct {
mtapi_group_hndl_t
handle
;
mtapi_group_hndl_t
handle
;
mtapi_group_id_t
group_id
;
mtapi_group_id_t
group_id
;
volatile
mtapi_boolean_
t
deleted
;
embb_atomic_in
t
deleted
;
embb_atomic_int
num_tasks
;
embb_atomic_int
num_tasks
;
mtapi_group_attributes_t
attributes
;
mtapi_group_attributes_t
attributes
;
embb_mtapi_task_queue_t
queue
;
embb_mtapi_task_queue_t
queue
;
...
...
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