projects
/
libcds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
94c1597
)
Small improvements in TsigasCycleQueue
author
khizmax
<libcds.dev@gmail.com>
Sat, 28 Nov 2015 11:21:58 +0000
(14:21 +0300)
committer
khizmax
<libcds.dev@gmail.com>
Sat, 28 Nov 2015 11:21:58 +0000
(14:21 +0300)
cds/intrusive/tsigas_cycle_queue.h
patch
|
blob
|
history
diff --git
a/cds/intrusive/tsigas_cycle_queue.h
b/cds/intrusive/tsigas_cycle_queue.h
index 4dd1578936f0baebe6a1423ae2b32dd561f87143..79a34dbde278ab620cd13fffc22c6a459fafca3b 100644
(file)
--- a/
cds/intrusive/tsigas_cycle_queue.h
+++ b/
cds/intrusive/tsigas_cycle_queue.h
@@
-184,7
+184,7
@@
namespace cds { namespace intrusive {
static bool is_free( const value_type * p ) CDS_NOEXCEPT
{
static bool is_free( const value_type * p ) CDS_NOEXCEPT
{
- return
p == reinterpret_cast<value_type *>(free0) || p == reinterpret_cast<value_type *>(free1)
;
+ return
(reinterpret_cast<intptr_t>(p) & ~intptr_t(1)) == 0
;
}
size_t CDS_CONSTEXPR buffer_capacity() const CDS_NOEXCEPT
}
size_t CDS_CONSTEXPR buffer_capacity() const CDS_NOEXCEPT
@@
-248,7
+248,7
@@
namespace cds { namespace intrusive {
temp = (temp + 1) & nModulo;
}
temp = (temp + 1) & nModulo;
}
- if ( te != m_nTail.load(memory_model::memory_order_
relaxed
) )
+ if ( te != m_nTail.load(memory_model::memory_order_
acquire
) )
continue;
// Check whether queue is full
continue;
// Check whether queue is full
@@
-266,7
+266,7
@@
namespace cds { namespace intrusive {
if ( tt == reinterpret_cast<value_type *>(free1) )
pNewNode = reinterpret_cast<value_type *>(reinterpret_cast<intptr_t>( pNewNode ) | 1);
if ( tt == reinterpret_cast<value_type *>(free1) )
pNewNode = reinterpret_cast<value_type *>(reinterpret_cast<intptr_t>( pNewNode ) | 1);
- if ( te != m_nTail.load(memory_model::memory_order_
relaxed
) )
+ if ( te != m_nTail.load(memory_model::memory_order_
acquire
) )
continue;
// get actual tail and try to enqueue new node
continue;
// get actual tail and try to enqueue new node