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
94ee1624
Commit
94ee1624
authored
Jun 08, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use boost threads only for GCC < 4.7 on Mac OS
parent
1a2ba785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
cppa/detail/thread.hpp
cppa/detail/thread.hpp
+5
-1
src/thread_pool_scheduler.cpp
src/thread_pool_scheduler.cpp
+2
-2
No files found.
cppa/detail/thread.hpp
View file @
94ee1624
...
@@ -31,7 +31,9 @@
...
@@ -31,7 +31,9 @@
#ifndef THREAD_HPP
#ifndef THREAD_HPP
#define THREAD_HPP
#define THREAD_HPP
#ifdef __APPLE__
#if defined(__APPLE__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 7) && !defined(__clang__)
#define CPPA_USE_BOOST_THREADS
#include <boost/thread.hpp>
#include <boost/thread.hpp>
#include "cppa/util/duration.hpp"
#include "cppa/util/duration.hpp"
...
@@ -80,6 +82,8 @@ inline boost::system_time& operator+=(boost::system_time& lhs,
...
@@ -80,6 +82,8 @@ inline boost::system_time& operator+=(boost::system_time& lhs,
#else
#else
#define CPPA_USE_STD_THREADS
#include <mutex>
#include <mutex>
#include <thread>
#include <thread>
#include <condition_variable>
#include <condition_variable>
...
...
src/thread_pool_scheduler.cpp
View file @
94ee1624
...
@@ -90,7 +90,7 @@ struct thread_pool_scheduler::worker {
...
@@ -90,7 +90,7 @@ struct thread_pool_scheduler::worker {
if
(
result
)
{
if
(
result
)
{
return
result
;
return
result
;
}
}
# ifdef
__APPLE__
# ifdef
CPPA_USE_BOOST_THREADS
auto
timeout
=
boost
::
get_system_time
();
auto
timeout
=
boost
::
get_system_time
();
timeout
+=
boost
::
posix_time
::
milliseconds
(
1
);
timeout
+=
boost
::
posix_time
::
milliseconds
(
1
);
boost
::
this_thread
::
sleep
(
timeout
);
boost
::
this_thread
::
sleep
(
timeout
);
...
@@ -108,7 +108,7 @@ struct thread_pool_scheduler::worker {
...
@@ -108,7 +108,7 @@ struct thread_pool_scheduler::worker {
if
(
result
)
{
if
(
result
)
{
return
result
;
return
result
;
}
}
# ifdef
__APPLE__
# ifdef
CPPA_USE_BOOST_THREADS
auto
timeout
=
boost
::
get_system_time
();
auto
timeout
=
boost
::
get_system_time
();
timeout
+=
boost
::
posix_time
::
milliseconds
(
10
);
timeout
+=
boost
::
posix_time
::
milliseconds
(
10
);
boost
::
this_thread
::
sleep
(
timeout
);
boost
::
this_thread
::
sleep
(
timeout
);
...
...
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