Skip to content

Commit 48294dc

Browse files
committed
Merge remote-tracking branch 'origin/master' into buildandroid
2 parents 9f94ea6 + 3a140eb commit 48294dc

File tree

10 files changed

+421
-390
lines changed

10 files changed

+421
-390
lines changed

Release/include/cpprest/astreambuf.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
****/
1414
#pragma once
1515

16+
#include <math.h>
17+
#include <atomic>
18+
#include <cstring>
1619
#include <ios>
1720
#include <memory>
18-
#include <cstring>
19-
#include <math.h>
2021

2122
#include "pplx/pplxtasks.h"
2223
#include "cpprest/details/basic_types.h"
@@ -745,7 +746,10 @@ namespace streams
745746

746747
std::exception_ptr m_currentException;
747748
// The in/out mode for the buffer
748-
bool m_stream_can_read, m_stream_can_write, m_stream_read_eof, m_alloced;
749+
std::atomic<bool> m_stream_can_read;
750+
std::atomic<bool> m_stream_can_write;
751+
std::atomic<bool> m_stream_read_eof;
752+
std::atomic<bool> m_alloced;
749753

750754

751755
private:
@@ -1208,5 +1212,3 @@ namespace streams
12081212
};
12091213

12101214
}}
1211-
1212-

Release/include/pplx/pplxlinux.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
#include <boost/thread/mutex.hpp>
3030
#include <boost/thread/condition_variable.hpp>
3131
#else
32-
#include <mutex>
32+
#include <mutex>
33+
#include <atomic>
3334
#include <condition_variable>
3435
#endif
3536

@@ -80,7 +81,7 @@ namespace platform
8081
static const unsigned int timeout_infinite = 0xFFFFFFFF;
8182

8283
event_impl()
83-
: _signaled(false)
84+
: _signaled(false)
8485
{
8586
}
8687

@@ -209,7 +210,7 @@ namespace platform
209210
_M_cs.lock();
210211
_M_owner = id;
211212
_M_recursionCount = 1;
212-
}
213+
}
213214
}
214215

215216
void unlock()
@@ -223,12 +224,12 @@ namespace platform
223224
{
224225
_M_owner = -1;
225226
_M_cs.unlock();
226-
}
227+
}
227228
}
228229

229230
private:
230231
cpprest_synchronization::mutex _M_cs;
231-
volatile long _M_owner;
232+
std::atomic<long> _M_owner;
232233
long _M_recursionCount;
233234
};
234235

@@ -298,7 +299,7 @@ namespace extensibility
298299
#else
299300
typedef details::linux_scheduler default_scheduler_t;
300301
#endif
301-
302+
302303
namespace details
303304
{
304305
/// <summary>

0 commit comments

Comments
 (0)