23
23
#include " pthread.h"
24
24
#include < signal.h>
25
25
26
- #if defined(__APPLE__)
27
- #include < boost/thread/condition_variable.hpp>
28
- #include < boost/thread/mutex.hpp>
29
- #include < dispatch/dispatch.h>
30
- #else
31
26
#include < atomic>
32
27
#include < condition_variable>
33
28
#include < mutex>
34
- #endif
35
29
36
30
#include " pplx/pplxinterface.h"
37
31
38
32
namespace pplx
39
33
{
40
- #if defined(__APPLE__)
41
- namespace cpprest_synchronization = ::boost;
42
- #else
43
- namespace cpprest_synchronization = ::std;
44
- #endif
45
34
namespace details
46
35
{
47
36
namespace platform
@@ -68,8 +57,8 @@ __declspec(noinline) inline static size_t CaptureCallstack(void**, size_t, size_
68
57
class event_impl
69
58
{
70
59
private:
71
- cpprest_synchronization ::mutex _lock;
72
- cpprest_synchronization ::condition_variable _condition;
60
+ std ::mutex _lock;
61
+ std ::condition_variable _condition;
73
62
bool _signaled;
74
63
75
64
public:
@@ -79,28 +68,28 @@ class event_impl
79
68
80
69
void set ()
81
70
{
82
- cpprest_synchronization ::lock_guard<cpprest_synchronization ::mutex> lock (_lock);
71
+ std ::lock_guard<std ::mutex> lock (_lock);
83
72
_signaled = true ;
84
73
_condition.notify_all ();
85
74
}
86
75
87
76
void reset ()
88
77
{
89
- cpprest_synchronization ::lock_guard<cpprest_synchronization ::mutex> lock (_lock);
78
+ std ::lock_guard<std ::mutex> lock (_lock);
90
79
_signaled = false ;
91
80
}
92
81
93
82
unsigned int wait (unsigned int timeout)
94
83
{
95
- cpprest_synchronization ::unique_lock<cpprest_synchronization ::mutex> lock (_lock);
84
+ std ::unique_lock<std ::mutex> lock (_lock);
96
85
if (timeout == event_impl::timeout_infinite)
97
86
{
98
87
_condition.wait (lock, [this ]() -> bool { return _signaled; });
99
88
return 0 ;
100
89
}
101
90
else
102
91
{
103
- cpprest_synchronization ::chrono::milliseconds period (timeout);
92
+ std ::chrono::milliseconds period (timeout);
104
93
auto status = _condition.wait_for (lock, period, [this ]() -> bool { return _signaled; });
105
94
_ASSERTE (status == _signaled);
106
95
// Return 0 if the wait completed as a result of signaling the event. Otherwise, return timeout_infinite
@@ -195,7 +184,7 @@ class recursive_lock_impl
195
184
}
196
185
197
186
private:
198
- cpprest_synchronization ::mutex _M_cs;
187
+ std ::mutex _M_cs;
199
188
std::atomic<long > _M_owner;
200
189
long _M_recursionCount;
201
190
};
@@ -219,7 +208,7 @@ class linux_scheduler : public pplx::scheduler_interface
219
208
220
209
// / <summary>
221
210
// / A generic RAII wrapper for locks that implements the critical_section interface
222
- // / cpprest_synchronization ::lock_guard
211
+ // / std ::lock_guard
223
212
// / </summary>
224
213
template <class _Lock >
225
214
class scoped_lock
@@ -244,7 +233,7 @@ namespace extensibility
244
233
{
245
234
typedef ::pplx::details::event_impl event_t ;
246
235
247
- typedef cpprest_synchronization ::mutex critical_section_t ;
236
+ typedef std ::mutex critical_section_t ;
248
237
typedef scoped_lock<critical_section_t > scoped_critical_section_t ;
249
238
250
239
typedef ::pplx::details::reader_writer_lock_impl reader_writer_lock_t ;
0 commit comments