Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
58e4e1b6
Commit
58e4e1b6
authored
Jul 25, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apple clang 4.0 compatibility
parent
2b2cf282
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
cppa/primitive_variant.hpp
cppa/primitive_variant.hpp
+14
-14
src/shared_spinlock.cpp
src/shared_spinlock.cpp
+3
-3
No files found.
cppa/primitive_variant.hpp
View file @
58e4e1b6
...
...
@@ -103,20 +103,20 @@ class primitive_variant {
};
// use static call dispatching to select member
inline
auto
get
(
util
::
pt_token
<
pt_int8
>
)
->
decltype
(
i8
)
&
{
return
i8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int16
>
)
->
decltype
(
i16
)
&
{
return
i16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int32
>
)
->
decltype
(
i32
)
&
{
return
i32
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int64
>
)
->
decltype
(
i64
)
&
{
return
i64
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint8
>
)
->
decltype
(
u8
)
&
{
return
u8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint16
>
)
->
decltype
(
u16
)
&
{
return
u16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint32
>
)
->
decltype
(
u32
)
&
{
return
u32
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint64
>
)
->
decltype
(
u64
)
&
{
return
u64
;
}
inline
auto
get
(
util
::
pt_token
<
pt_float
>
)
->
decltype
(
fl
)
&
{
return
fl
;
}
inline
auto
get
(
util
::
pt_token
<
pt_double
>
)
->
decltype
(
db
)
&
{
return
db
;
}
inline
auto
get
(
util
::
pt_token
<
pt_long_double
>
)
->
decltype
(
ldb
)
&
{
return
ldb
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u8string
>
)
->
decltype
(
s8
)
&
{
return
s8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u16string
>
)
->
decltype
(
s16
)
&
{
return
s16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u32string
>
)
->
decltype
(
s32
)
&
{
return
s32
;
}
inline
std
::
int8_t
&
get
(
util
::
pt_token
<
pt_int8
>
)
{
return
i8
;
}
inline
std
::
int16_t
&
get
(
util
::
pt_token
<
pt_int16
>
)
{
return
i16
;
}
inline
std
::
int32_t
&
get
(
util
::
pt_token
<
pt_int32
>
)
{
return
i32
;
}
inline
std
::
int64_t
&
get
(
util
::
pt_token
<
pt_int64
>
)
{
return
i64
;
}
inline
std
::
uint8_t
&
get
(
util
::
pt_token
<
pt_uint8
>
)
{
return
u8
;
}
inline
std
::
uint16_t
&
get
(
util
::
pt_token
<
pt_uint16
>
)
{
return
u16
;
}
inline
std
::
uint32_t
&
get
(
util
::
pt_token
<
pt_uint32
>
)
{
return
u32
;
}
inline
std
::
uint64_t
&
get
(
util
::
pt_token
<
pt_uint64
>
)
{
return
u64
;
}
inline
float
&
get
(
util
::
pt_token
<
pt_float
>
)
{
return
fl
;
}
inline
double
&
get
(
util
::
pt_token
<
pt_double
>
)
{
return
db
;
}
inline
long
double
&
get
(
util
::
pt_token
<
pt_long_double
>
)
{
return
ldb
;
}
inline
std
::
string
&
get
(
util
::
pt_token
<
pt_u8string
>
)
{
return
s8
;
}
inline
std
::
u16string
&
get
(
util
::
pt_token
<
pt_u16string
>
)
{
return
s16
;
}
inline
std
::
u32string
&
get
(
util
::
pt_token
<
pt_u32string
>
)
{
return
s32
;
}
// get(...) const overload
template
<
primitive_type
PT
>
...
...
src/shared_spinlock.cpp
View file @
58e4e1b6
...
...
@@ -36,7 +36,7 @@
namespace
{
constexpr
long
min_long
=
std
::
numeric_limits
<
long
>::
min
();
inline
long
min_long
()
{
return
std
::
numeric_limits
<
long
>::
min
();
}
}
// namespace <anonymous>
...
...
@@ -53,7 +53,7 @@ void shared_spinlock::lock() {
//std::this_thread::yield();
v
=
m_flag
.
load
();
}
else
if
(
m_flag
.
compare_exchange_weak
(
v
,
min_long
))
{
else
if
(
m_flag
.
compare_exchange_weak
(
v
,
min_long
()
))
{
return
;
}
// else: next iteration
...
...
@@ -71,7 +71,7 @@ void shared_spinlock::unlock() {
bool
shared_spinlock
::
try_lock
()
{
long
v
=
m_flag
.
load
();
return
(
v
==
0
)
?
m_flag
.
compare_exchange_weak
(
v
,
min_long
)
:
false
;
return
(
v
==
0
)
?
m_flag
.
compare_exchange_weak
(
v
,
min_long
()
)
:
false
;
}
void
shared_spinlock
::
lock_shared
()
{
...
...
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