Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fastclick
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
SDN PP
fastclick
Commits
d7908e80
Commit
d7908e80
authored
Apr 11, 2018
by
Tom Barbette
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hashtablemp: Reference the table's _mt
Make CLANG happy too
parent
c9adf651
Pipeline
#1807
passed with stage
in 10 minutes and 7 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
include/click/hashtablemp.hh
include/click/hashtablemp.hh
+12
-10
No files found.
include/click/hashtablemp.hh
View file @
d7908e80
...
...
@@ -73,10 +73,10 @@ class HashContainerMP { public:
~
iterator
()
{
if
(
_h
)
{
if
(
_b
<
_h
->
_table
->
_nbuckets
)
{
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
read_end
();
}
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
.
read_end
();
}
}
...
...
@@ -90,10 +90,10 @@ class HashContainerMP { public:
}
while
(
!
_item
)
{
//click_chatter("Bucket %d : %p",_b,_h->_table->buckets[_b]);
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
read_end
();
if
(
++
_b
==
_h
->
_table
->
_nbuckets
)
return
;
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
read_begin
();
_item
=
_h
->
_table
->
buckets
[
_b
].
list
->
head
;
_prev
=
0
;
...
...
@@ -134,7 +134,7 @@ class HashContainerMP { public:
//global read lock must be held!
iterator
(
HashContainerMP
<
K
,
V
,
Item
>*
h
)
:
_h
(
h
),
_prev
(
0
)
{
_b
=
0
;
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
read_begin
();
_item
=
_h
->
_table
->
buckets
[
_b
].
list
->
head
;
if
(
_item
==
0
)
{
...
...
@@ -153,10 +153,10 @@ class HashContainerMP { public:
~
write_iterator
()
{
if
(
_h
)
{
if
(
_b
<
_h
->
_table
->
_nbuckets
)
{
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
write_end
();
}
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
.
read_end
();
}
_h
=
0
;
//Prevent read destruction
...
...
@@ -170,10 +170,10 @@ class HashContainerMP { public:
_prev
=
_item
;
}
while
(
!
_item
)
{
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
write_end
();
if
(
++
_b
==
_h
->
_table
->
_nbuckets
)
return
;
if
(
likely
(
_mt
))
if
(
likely
(
_
h
->
_
mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
write_begin
();
_item
=
_h
->
_table
->
buckets
[
_b
].
list
->
head
;
_prev
=
0
;
...
...
@@ -218,7 +218,7 @@ class HashContainerMP { public:
//global read lock must be held!
write_iterator
(
HashContainerMP
<
K
,
V
,
Item
>*
h
)
:
_h
(
h
),
_prev
(
0
)
{
_b
=
0
;
if
(
likely
(
_mt
))
if
(
likely
(
h
->
_mt
))
_h
->
_table
->
buckets
[
_b
].
list
.
write_begin
();
_item
=
_h
->
_table
->
buckets
[
_b
].
list
->
head
;
if
(
_item
==
0
)
{
...
...
@@ -371,6 +371,8 @@ class HashContainerMP { public:
}
}
friend
class
iterator
;
};
template
<
typename
K
,
typename
V
,
typename
Item
>
...
...
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