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
8ab26a0b
Commit
8ab26a0b
authored
Nov 17, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extern C and clean up soem comments
Extern C is not included in the RIOT headers.
parent
65fbdbbe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
63 deletions
+11
-63
libcaf_core/caf/chrono.hpp
libcaf_core/caf/chrono.hpp
+0
-2
libcaf_core/caf/condition_variable.hpp
libcaf_core/caf/condition_variable.hpp
+5
-7
libcaf_core/caf/mutex.hpp
libcaf_core/caf/mutex.hpp
+2
-44
libcaf_core/caf/thread.hpp
libcaf_core/caf/thread.hpp
+4
-6
libcaf_core/src/condition_variable.cpp
libcaf_core/src/condition_variable.cpp
+0
-2
libcaf_core/src/thread.cpp
libcaf_core/src/thread.cpp
+0
-2
No files found.
libcaf_core/caf/chrono.hpp
View file @
8ab26a0b
...
@@ -27,10 +27,8 @@
...
@@ -27,10 +27,8 @@
#ifdef __RIOTBUILD_FLAG
#ifdef __RIOTBUILD_FLAG
extern
"C"
{
#include "time.h"
#include "time.h"
#include "vtimer.h"
#include "vtimer.h"
}
namespace
caf
{
namespace
caf
{
...
...
libcaf_core/caf/condition_variable.hpp
View file @
8ab26a0b
...
@@ -24,15 +24,13 @@
...
@@ -24,15 +24,13 @@
#ifdef __RIOTBUILD_FLAG
#ifdef __RIOTBUILD_FLAG
#include "mutex.hpp"
#include "sched.h"
#include "vtimer.h"
#include "caf/
chrono
.hpp"
#include "caf/
mutex
.hpp"
#include "caf/chrono.hpp"
extern
"C"
{
#include "sched.h"
#include "vtimer.h"
}
namespace
caf
{
namespace
caf
{
...
@@ -116,7 +114,7 @@ cv_status condition_variable::wait_for(unique_lock<mutex>& lock,
...
@@ -116,7 +114,7 @@ cv_status condition_variable::wait_for(unique_lock<mutex>& lock,
timex_t
timeout
,
before
,
after
;
timex_t
timeout
,
before
,
after
;
auto
s
=
duration_cast
<
seconds
>
(
timeout_duration
);
auto
s
=
duration_cast
<
seconds
>
(
timeout_duration
);
timeout
.
seconds
=
s
.
count
();
timeout
.
seconds
=
s
.
count
();
timeout
.
microseconds
=
(
duration_cast
<
microseconds
>
(
timeout_duration
)
-
s
).
count
();
timeout
.
microseconds
=
(
duration_cast
<
microseconds
>
(
timeout_duration
-
s
)
).
count
();
vtimer_now
(
&
before
);
vtimer_now
(
&
before
);
vtimer_t
timer
;
vtimer_t
timer
;
vtimer_set_wakeup
(
&
timer
,
timeout
,
sched_active_pid
);
vtimer_set_wakeup
(
&
timer
,
timeout
,
sched_active_pid
);
...
...
libcaf_core/caf/mutex.hpp
View file @
8ab26a0b
...
@@ -23,16 +23,11 @@
...
@@ -23,16 +23,11 @@
#ifdef __RIOTBUILD_FLAG
#ifdef __RIOTBUILD_FLAG
#include "mutex.h"
#include <utility>
#include <utility>
//#include <system_error>
#include <stdexcept>
#include <stdexcept>
#include <cstdio>
extern
"C"
{
#include "mutex.h"
}
namespace
caf
{
namespace
caf
{
class
mutex
{
class
mutex
{
...
@@ -94,15 +89,6 @@ class unique_lock {
...
@@ -94,15 +89,6 @@ class unique_lock {
:
m_mtx
{
&
mtx
},
m_owns
{
mtx
.
try_lock
()
}
{
}
:
m_mtx
{
&
mtx
},
m_owns
{
mtx
.
try_lock
()
}
{
}
inline
unique_lock
(
mutex_type
&
mtx
,
adopt_lock_t
)
inline
unique_lock
(
mutex_type
&
mtx
,
adopt_lock_t
)
:
m_mtx
{
&
mtx
},
m_owns
{
true
}
{
}
:
m_mtx
{
&
mtx
},
m_owns
{
true
}
{
}
// template<class Clock, class Duration>
// inline unique_lock(mutex_type& mtx,
// const std::chrono::time_point<Clock,
// Duration>& timeout_time)
// : m_mtx{&mtx}, m_owns{mtx.try_lock_until(timeout_time)} { }
// template<class Rep, class Period>
// inline unique_lock(mutex_type& mtx,
// const chrono::duration<Rep,Period>& timeout_duration)
// : m_mtx{&mtx}, m_owns{mtx.try_lock_for(timeout_duration)} { }
inline
~
unique_lock
()
{
inline
~
unique_lock
()
{
if
(
m_owns
)
{
if
(
m_owns
)
{
m_mtx
->
unlock
();
m_mtx
->
unlock
();
...
@@ -183,34 +169,6 @@ bool unique_lock<Mutex>::try_lock() {
...
@@ -183,34 +169,6 @@ bool unique_lock<Mutex>::try_lock() {
return
m_owns
;
return
m_owns
;
}
}
//template<class Mutex>
//template<class Rep, class Period>
//bool unique_lock<Mutex>
// ::try_lock_for(const std::chrono::duration<Rep,Period>& timeout_duration) {
// if (m_mtx == nullptr) {
// throw std::runtime_error("unique_lock::try_lock_for: references null mutex");
// }
// if (m_owns) {
// throw std::runtime_error("unique_lock::try_lock_for: already locked");
// }
// m_owns = m_mtx->try_lock_until(timeout_duration);
// return m_owns;
//}
//template <class Mutex>
//template <class Clock, class Duration>
//bool unique_lock<Mutex>
// ::try_lock_until(const chrono::time_point<Clock, Duration>& timeout_time) {
// if (m_mtx == nullptr)
// throw std::runtime_error("unique_lock::try_lock_until: "
// "references null mutex");
// if (m_owns)
// throw std::runtime_error("unique_lock::try_lock_until: "
// "already locked");
// m_owns = m_mtx->try_lock_until(timeout_time);
// return m_owns;
//}
template
<
class
Mutex
>
template
<
class
Mutex
>
void
unique_lock
<
Mutex
>::
unlock
()
{
void
unique_lock
<
Mutex
>::
unlock
()
{
if
(
!
m_owns
)
{
if
(
!
m_owns
)
{
...
...
libcaf_core/caf/thread.hpp
View file @
8ab26a0b
...
@@ -23,6 +23,10 @@
...
@@ -23,6 +23,10 @@
#ifdef __RIOTBUILD_FLAG
#ifdef __RIOTBUILD_FLAG
#include "time.h"
#include "thread.h"
#include "kernel_internal.h"
#include <tuple>
#include <tuple>
#include <memory>
#include <memory>
#include <utility>
#include <utility>
...
@@ -31,12 +35,6 @@
...
@@ -31,12 +35,6 @@
#include <functional>
#include <functional>
#include <type_traits>
#include <type_traits>
extern
"C"
{
#include "time.h"
#include "thread.h"
#include "kernel_internal.h"
}
#include "caf/mutex.hpp"
#include "caf/mutex.hpp"
#include "caf/chrono.hpp"
#include "caf/chrono.hpp"
#include "caf/ref_counted.hpp"
#include "caf/ref_counted.hpp"
...
...
libcaf_core/src/condition_variable.cpp
View file @
8ab26a0b
...
@@ -21,12 +21,10 @@
...
@@ -21,12 +21,10 @@
#include <cstdio>
#include <cstdio>
#include <stdexcept>
#include <stdexcept>
extern
"C"
{
#include "irq.h"
#include "irq.h"
#include "sched.h"
#include "sched.h"
#include "vtimer.h"
#include "vtimer.h"
#include "priority_queue.h"
#include "priority_queue.h"
}
#include "caf/condition_variable.hpp"
#include "caf/condition_variable.hpp"
...
...
libcaf_core/src/thread.cpp
View file @
8ab26a0b
...
@@ -18,9 +18,7 @@
...
@@ -18,9 +18,7 @@
* http://www.boost.org/LICENSE_1_0.txt. *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
******************************************************************************/
extern
"C"
{
#include "vtimer.h"
#include "vtimer.h"
}
#include <cerrno>
#include <cerrno>
#include <system_error>
#include <system_error>
...
...
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