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
ac478ced
Commit
ac478ced
authored
Mar 10, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear schedule when cancelling the clock's thread
parent
1a1fedfd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
libcaf_core/src/thread_safe_actor_clock.cpp
libcaf_core/src/thread_safe_actor_clock.cpp
+30
-15
No files found.
libcaf_core/src/thread_safe_actor_clock.cpp
View file @
ac478ced
...
@@ -35,52 +35,66 @@ void thread_safe_actor_clock::set_receive_timeout(time_point t,
...
@@ -35,52 +35,66 @@ void thread_safe_actor_clock::set_receive_timeout(time_point t,
abstract_actor
*
self
,
abstract_actor
*
self
,
uint32_t
id
)
{
uint32_t
id
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
set_receive_timeout
(
t
,
self
,
id
);
super
::
set_receive_timeout
(
t
,
self
,
id
);
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
set_request_timeout
(
time_point
t
,
void
thread_safe_actor_clock
::
set_request_timeout
(
time_point
t
,
abstract_actor
*
self
,
abstract_actor
*
self
,
message_id
id
)
{
message_id
id
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
set_request_timeout
(
t
,
self
,
id
);
super
::
set_request_timeout
(
t
,
self
,
id
);
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
cancel_receive_timeout
(
abstract_actor
*
self
)
{
void
thread_safe_actor_clock
::
cancel_receive_timeout
(
abstract_actor
*
self
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
cancel_receive_timeout
(
self
);
super
::
cancel_receive_timeout
(
self
);
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
cancel_request_timeout
(
abstract_actor
*
self
,
void
thread_safe_actor_clock
::
cancel_request_timeout
(
abstract_actor
*
self
,
message_id
id
)
{
message_id
id
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
cancel_request_timeout
(
self
,
id
);
super
::
cancel_request_timeout
(
self
,
id
);
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
cancel_timeouts
(
abstract_actor
*
self
)
{
void
thread_safe_actor_clock
::
cancel_timeouts
(
abstract_actor
*
self
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
cancel_timeouts
(
self
);
super
::
cancel_timeouts
(
self
);
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
schedule_message
(
time_point
t
,
void
thread_safe_actor_clock
::
schedule_message
(
time_point
t
,
strong_actor_ptr
receiver
,
strong_actor_ptr
receiver
,
mailbox_element_ptr
content
)
{
mailbox_element_ptr
content
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
schedule_message
(
t
,
std
::
move
(
receiver
),
std
::
move
(
content
));
super
::
schedule_message
(
t
,
std
::
move
(
receiver
),
std
::
move
(
content
));
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
schedule_message
(
time_point
t
,
group
target
,
void
thread_safe_actor_clock
::
schedule_message
(
time_point
t
,
group
target
,
strong_actor_ptr
sender
,
strong_actor_ptr
sender
,
message
content
)
{
message
content
)
{
guard_type
guard
{
mx_
};
guard_type
guard
{
mx_
};
if
(
!
done_
)
{
super
::
schedule_message
(
t
,
std
::
move
(
target
),
std
::
move
(
sender
),
super
::
schedule_message
(
t
,
std
::
move
(
target
),
std
::
move
(
sender
),
std
::
move
(
content
));
std
::
move
(
content
));
cv_
.
notify_all
();
cv_
.
notify_all
();
}
}
}
void
thread_safe_actor_clock
::
run_dispatch_loop
()
{
void
thread_safe_actor_clock
::
run_dispatch_loop
()
{
...
@@ -104,6 +118,7 @@ void thread_safe_actor_clock::run_dispatch_loop() {
...
@@ -104,6 +118,7 @@ void thread_safe_actor_clock::run_dispatch_loop() {
}
}
}
}
}
}
schedule_
.
clear
();
}
}
void
thread_safe_actor_clock
::
cancel_dispatch_loop
()
{
void
thread_safe_actor_clock
::
cancel_dispatch_loop
()
{
...
...
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