<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
<div class="moz-cite-prefix">On 16/2/24 上午1:39, Piotr Caban wrote:<br>
</div>
<blockquote cite="mid:56CC9969.60204@gmail.com" type="cite">On
02/23/16 18:12, YongHao Hu wrote:
<br>
<blockquote type="cite">As we can refer to some implementation of
Microsoft[1], do you think it
<br>
would become easier?
<br>
</blockquote>
I didn't look on it yet so I have no clue if it's going to be
helpful. Probably yes.
<br>
<br>
<blockquote type="cite">For example, the event class[2] can refer
to the pplxlinux.h[3],
<br>
TaskCollection[4] can refer to pplx.h[5] and
<br>
reader_writer_lock[6] can refer to pplxlinux.h[7] etc.
<br>
</blockquote>
You can get similar information from C++ standard description. You
can get some basic information from there but wine's
implementation will need to be binary compatible (or at least
structures will need to have the same size as on windows).
<br>
<br>
</blockquote>
I want to mention that even the structures, class and functions have
implementation in the open-source project.[1,2,3]<br>
For example, in [1], as far as I am concerned, we can implement
Class event in Wine base on this. Of course, we also need to be
binary compatible.<br>
<meta charset="utf-8">
<small> class event_impl {<br>
private:<br>
cpprest_synchronization::mutex _lock;<br>
cpprest_synchronization::condition_variable
_condition;<br>
bool _signaled;<br>
public:<br>
static const unsigned int timeout_infinite =
0xFFFFFFFF;<br>
event_impl() : _signaled(false) { }<br>
void set() {<br>
cpprest_synchronization::lock_guard<cpprest_synchronization::mutex>
lock(_lock);<br>
_signaled = true;<br>
_condition.notify_all();<br>
}<br>
void reset() {<br>
cpprest_synchronization::lock_guard<cpprest_synchronization::mutex>
lock(_lock);<br>
_signaled = false;<br>
}<br>
unsigned int wait(unsigned int timeout) {<br>
cpprest_synchronization::unique_lock<cpprest_synchronization::mutex>
lock(_lock);<br>
if (timeout == event_impl::timeout_infinite) {<br>
_condition.wait(lock, [this]() -> bool {
return _signaled; });<br>
return 0;<br>
} else {<br>
cpprest_synchronization::chrono::milliseconds
period(timeout);<br>
auto status = _condition.wait_for(lock,
period, [this]() -> bool { return _signaled; });<br>
_ASSERTE(status == _signaled);<br>
// Return 0 if the wait completed as a result
of signaling the event. Otherwise, return timeout_infinite<br>
// Note: this must be consistent with the
behavior of the Windows version, which is based on
WaitForSingleObjectEx<br>
return status ? 0:
event_impl::timeout_infinite;<br>
}<br>
};</small><br>
<br>
<br>
<blockquote cite="mid:56CC9969.60204@gmail.com" type="cite">
<blockquote type="cite">My simple plan may like this:
<br>
Add tests to critical session.
<br>
Implement Class condition variable first, which can refer
to BOOST
<br>
and tests.
<br>
Implement Class event and tests.
<br>
Implement Class TaskCollection and tests.
<br>
Implement Class reader_writer_lock and tests.
<br>
Else: Find something that I think I can handle.
<br>
<br>
Do you think such a plan would satisfy GSoC's requirement?
<br>
</blockquote>
Sorry, I don't know much about Concurrency namespace yet. I just
wanted to warn you that it may be harder then you expect. </blockquote>
<br>
Thank you for your attention. I will consider it deeply.<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<a class="moz-txt-link-freetext"
href="https://msdn.microsoft.com/en-us/library/dd492846.aspx"></a><br>
[1]:
<a class="moz-txt-link-freetext"
href="https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplxlinux.h#L84">https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplxlinux.h#L84</a><br>
[2]:
<a class="moz-txt-link-freetext"
href="https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplx.h#L146">https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplx.h#L146</a><br>
[3]:
<a class="moz-txt-link-freetext"
href="https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplxlinux.h#L140">https://github.com/Microsoft/cpprestsdk/blob/master/Release/include/pplx/pplxlinux.h#L140</a>
</body>
</html>