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
8b5e2682
authored
Oct 06, 2014
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: fixed internal issue #220 (Fix typo "ids_availabe" in struct member)
parent
53072afc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
mtapi_c/src/embb_mtapi_id_pool_t.c
+6
-6
mtapi_c/src/embb_mtapi_id_pool_t.h
+1
-1
No files found.
mtapi_c/src/embb_mtapi_id_pool_t.c
View file @
8b5e2682
...
@@ -42,7 +42,7 @@ void embb_mtapi_id_pool_initialize(
...
@@ -42,7 +42,7 @@ void embb_mtapi_id_pool_initialize(
for
(
ii
=
1
;
ii
<
capacity
;
ii
++
)
{
for
(
ii
=
1
;
ii
<
capacity
;
ii
++
)
{
that
->
id_buffer
[
ii
]
=
ii
;
that
->
id_buffer
[
ii
]
=
ii
;
}
}
that
->
ids_availabe
=
capacity
-
1
;
that
->
ids_availab
l
e
=
capacity
-
1
;
that
->
put_id_position
=
0
;
that
->
put_id_position
=
0
;
that
->
get_id_position
=
1
;
that
->
get_id_position
=
1
;
embb_mtapi_spinlock_initialize
(
&
that
->
lock
);
embb_mtapi_spinlock_initialize
(
&
that
->
lock
);
...
@@ -50,7 +50,7 @@ void embb_mtapi_id_pool_initialize(
...
@@ -50,7 +50,7 @@ void embb_mtapi_id_pool_initialize(
void
embb_mtapi_id_pool_finalize
(
embb_mtapi_id_pool_t
*
that
)
{
void
embb_mtapi_id_pool_finalize
(
embb_mtapi_id_pool_t
*
that
)
{
that
->
capacity
=
0
;
that
->
capacity
=
0
;
that
->
ids_availabe
=
0
;
that
->
ids_availab
l
e
=
0
;
that
->
get_id_position
=
0
;
that
->
get_id_position
=
0
;
that
->
put_id_position
=
0
;
that
->
put_id_position
=
0
;
embb_mtapi_alloc_deallocate
(
that
->
id_buffer
);
embb_mtapi_alloc_deallocate
(
that
->
id_buffer
);
...
@@ -64,9 +64,9 @@ mtapi_uint_t embb_mtapi_id_pool_allocate(embb_mtapi_id_pool_t * that) {
...
@@ -64,9 +64,9 @@ mtapi_uint_t embb_mtapi_id_pool_allocate(embb_mtapi_id_pool_t * that) {
assert
(
MTAPI_NULL
!=
that
);
assert
(
MTAPI_NULL
!=
that
);
if
(
embb_mtapi_spinlock_acquire
(
&
that
->
lock
))
{
if
(
embb_mtapi_spinlock_acquire
(
&
that
->
lock
))
{
if
(
0
<
that
->
ids_availabe
)
{
if
(
0
<
that
->
ids_availab
l
e
)
{
/* take away one id */
/* take away one id */
that
->
ids_availabe
--
;
that
->
ids_availab
l
e
--
;
/* acquire position to fetch id from */
/* acquire position to fetch id from */
mtapi_uint_t
id_position
=
that
->
get_id_position
;
mtapi_uint_t
id_position
=
that
->
get_id_position
;
...
@@ -93,7 +93,7 @@ void embb_mtapi_id_pool_deallocate(
...
@@ -93,7 +93,7 @@ void embb_mtapi_id_pool_deallocate(
assert
(
MTAPI_NULL
!=
that
);
assert
(
MTAPI_NULL
!=
that
);
if
(
embb_mtapi_spinlock_acquire
(
&
that
->
lock
))
{
if
(
embb_mtapi_spinlock_acquire
(
&
that
->
lock
))
{
if
(
that
->
capacity
>
that
->
ids_availabe
)
{
if
(
that
->
capacity
>
that
->
ids_availab
l
e
)
{
/* acquire position to put id to */
/* acquire position to put id to */
mtapi_uint_t
id_position
=
that
->
put_id_position
;
mtapi_uint_t
id_position
=
that
->
put_id_position
;
that
->
put_id_position
++
;
that
->
put_id_position
++
;
...
@@ -105,7 +105,7 @@ void embb_mtapi_id_pool_deallocate(
...
@@ -105,7 +105,7 @@ void embb_mtapi_id_pool_deallocate(
that
->
id_buffer
[
id_position
]
=
id
;
that
->
id_buffer
[
id_position
]
=
id
;
/* make it available */
/* make it available */
that
->
ids_availabe
++
;
that
->
ids_availab
l
e
++
;
}
}
embb_mtapi_spinlock_release
(
&
that
->
lock
);
embb_mtapi_spinlock_release
(
&
that
->
lock
);
}
else
{
}
else
{
...
...
mtapi_c/src/embb_mtapi_id_pool_t.h
View file @
8b5e2682
...
@@ -48,7 +48,7 @@ extern "C" {
...
@@ -48,7 +48,7 @@ extern "C" {
struct
embb_mtapi_id_pool_struct
{
struct
embb_mtapi_id_pool_struct
{
mtapi_uint_t
capacity
;
mtapi_uint_t
capacity
;
mtapi_uint_t
*
id_buffer
;
mtapi_uint_t
*
id_buffer
;
mtapi_uint_t
ids_availabe
;
mtapi_uint_t
ids_availab
l
e
;
mtapi_uint_t
get_id_position
;
mtapi_uint_t
get_id_position
;
mtapi_uint_t
put_id_position
;
mtapi_uint_t
put_id_position
;
embb_mtapi_spinlock_t
lock
;
embb_mtapi_spinlock_t
lock
;
...
...
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