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
c47eea61
Commit
c47eea61
authored
Sep 26, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old code
parent
1594d7cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
libcaf_core/caf/mutex.hpp
libcaf_core/caf/mutex.hpp
+4
-11
libcaf_core/src/condition_variable.cpp
libcaf_core/src/condition_variable.cpp
+0
-2
No files found.
libcaf_core/caf/mutex.hpp
View file @
c47eea61
...
...
@@ -161,11 +161,9 @@ class unique_lock {
template
<
class
Mutex
>
void
unique_lock
<
Mutex
>::
lock
()
{
if
(
m_mtx
==
nullptr
)
{
//std::__throw_system_error(EPERM, "unique_lock::lock: references null mutex");
throw
std
::
runtime_error
(
"unique_lock::lock: references null mutex"
);
}
if
(
m_owns
)
{
//std::__throw_system_error(EDEADLK, "unique_lock::lock: already locked");
throw
std
::
runtime_error
(
""
);
}
m_mtx
->
lock
();
...
...
@@ -175,11 +173,9 @@ void unique_lock<Mutex>::lock() {
template
<
class
Mutex
>
bool
unique_lock
<
Mutex
>::
try_lock
()
{
if
(
m_mtx
==
nullptr
)
{
//std::__throw_system_error(EPERM,
throw
std
::
runtime_error
(
"unique_lock::try_lock: references null mutex"
);
}
if
(
m_owns
)
{
//std::__throw_system_error(EDEADLK, "unique_lock::try_lock: already locked");
throw
std
::
runtime_error
(
"unique_lock::try_lock lock: already locked"
);
}
m_owns
=
m_mtx
->
try_lock
();
...
...
@@ -191,12 +187,10 @@ bool unique_lock<Mutex>::try_lock() {
//bool unique_lock<Mutex>
// ::try_lock_for(const std::chrono::duration<Rep,Period>& timeout_duration) {
// if (m_mtx == nullptr) {
// std::__throw_system_error(EPERM, "unique_lock::try_lock_for:"
// " references null mutex");
// throw std::runtime_error("unique_lock::try_lock_for: references null mutex");
// }
// if (m_owns) {
// std::__throw_system_error(EDEADLK,
// "unique_lock::try_lock_for: already locked");
// throw std::runtime_error("unique_lock::try_lock_for: already locked");
// }
// m_owns = m_mtx->try_lock_until(timeout_duration);
// return m_owns;
...
...
@@ -207,10 +201,10 @@ bool unique_lock<Mutex>::try_lock() {
//bool unique_lock<Mutex>
// ::try_lock_until(const chrono::time_point<Clock, Duration>& timeout_time) {
// if (m_mtx == nullptr)
//
__throw_system_error(EPERM,
"unique_lock::try_lock_until: "
//
throw std::runtime_error(
"unique_lock::try_lock_until: "
// "references null mutex");
// if (m_owns)
//
__throw_system_error(EDEADLK,
"unique_lock::try_lock_until: "
//
throw std::runtime_error(
"unique_lock::try_lock_until: "
// "already locked");
// m_owns = m_mtx->try_lock_until(timeout_time);
// return m_owns;
...
...
@@ -219,7 +213,6 @@ bool unique_lock<Mutex>::try_lock() {
template
<
class
Mutex
>
void
unique_lock
<
Mutex
>::
unlock
()
{
if
(
!
m_owns
)
{
//std::__throw_system_error(EPERM, "unique_lock::unlock: not locked");
throw
std
::
runtime_error
(
"unique_lock::unlock: not locked"
);
}
m_mtx
->
unlock
();
...
...
libcaf_core/src/condition_variable.cpp
View file @
c47eea61
...
...
@@ -63,7 +63,6 @@ void condition_variable::notify_all() noexcept {
void
condition_variable
::
wait
(
unique_lock
<
mutex
>&
lock
)
noexcept
{
if
(
!
lock
.
owns_lock
())
{
// std::__throw_system_error(EPERM,
throw
std
::
runtime_error
(
"condition_variable::wait: mutex not locked"
);
}
priority_queue_node_t
n
;
...
...
@@ -90,7 +89,6 @@ void condition_variable::wait(unique_lock<mutex>& lock) noexcept {
time_point
<
system_clock
,
nanoseconds
>
tp
)
noexcept
{
if
(
!
lock
.
owns_lock
())
{
//std::__throw_system_error(EPERM,
throw
std
::
runtime_error
(
"condition_variable::timed wait: mutex not locked"
);
}
nanoseconds
d
=
tp
.
time_since_epoch
();
...
...
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