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
dcc96bfc
Commit
dcc96bfc
authored
Nov 22, 2019
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove intrusive_ptr functions
parent
77279674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
libcaf_core/caf/actor_storage.hpp
libcaf_core/caf/actor_storage.hpp
+0
-44
No files found.
libcaf_core/caf/actor_storage.hpp
View file @
dcc96bfc
...
...
@@ -92,50 +92,6 @@ private:
}
};
/// @relates actor_storage
template
<
class
T
>
bool
intrusive_ptr_upgrade_weak
(
actor_storage
<
T
>*
x
)
{
auto
count
=
x
->
ctrl
.
strong_refs
.
load
();
while
(
count
!=
0
)
{
if
(
x
->
ctrl
.
strong_refs
.
compare_exchange_weak
(
count
,
count
+
1
,
std
::
memory_order_relaxed
))
return
true
;
}
return
false
;
}
/// @relates actor_storage
template
<
class
T
>
void
intrusive_ptr_add_weak_ref
(
actor_storage
<
T
>*
x
)
{
x
->
ctrl
.
weak_refs
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
}
/// @relates actor_storage
template
<
class
T
>
void
intrusive_ptr_release_weak
(
actor_storage
<
T
>*
x
)
{
// destroy object if last weak pointer expires
if
(
x
->
ctrl
.
weak_refs
==
1
||
x
->
ctrl
.
weak_refs
.
fetch_sub
(
1
,
std
::
memory_order_acq_rel
)
==
1
)
delete
x
;
}
/// @relates actor_storage
template
<
class
T
>
void
intrusive_ptr_add_ref
(
actor_storage
<
T
>*
x
)
{
x
->
ctrl
.
strong_refs
.
fetch_add
(
1
,
std
::
memory_order_relaxed
);
}
/// @relates actor_storage
template
<
class
T
>
void
intrusive_ptr_release
(
actor_storage
<
T
>*
x
)
{
// release implicit weak pointer if the last strong ref expires
// and destroy the data block
if
(
x
->
ctrl
.
strong_refs
.
fetch_sub
(
1
,
std
::
memory_order_acq_rel
)
==
1
)
{
x
->
destroy_data
();
intrusive_ptr_release_weak
(
x
);
}
}
}
// namespace caf
#ifdef CAF_GCC
...
...
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