<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dolphin/Source/Core/Common/Thread.h, branch release-prep-2512</title>
<subtitle>GameCube and Wii emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/'/>
<entry>
<title>Jit: Don't use a second stack</title>
<updated>2023-02-28T19:29:46+00:00</updated>
<author>
<name>JosJuice</name>
<email>josjuice@gmail.com</email>
</author>
<published>2023-01-01T19:18:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=86c1f6e1e7e2abcc3f42e1182134e632b218b6d3'/>
<id>86c1f6e1e7e2abcc3f42e1182134e632b218b6d3</id>
<content type='text'>
This second stack leads to JNI problems on Android, because ART fetches
the address and size of the original stack using pthread functions
(see GetThreadStack in art/runtime/thread.cc), and (presumably) treats
stack addresses outside of the original stack as invalid. (What I don't
understand is why some JNI operations on the CPU thread work fine
despite this but others don't.)

Instead of creating a second stack, let's borrow the approach ART uses:
Use pthread functions to find out the stack's address and size, then
install guard pages at an appropriate location. This lets us get rid
of a workaround we had in the MsgAlert function.

Because we're no longer choosing the stack size ourselves, I've made some
tweaks to where the put the guard pages. Previously we had a stack of
2 MiB and a safe zone of 512 KiB. We now accept stacks as small as 512 KiB
(used on macOS) and use a safe zone of 256 KiB. I feel like this should
be fine, but haven't done much testing beyond "it seems to work".

By the way, on Windows it was already the case that we didn't create
a second stack... But there was a bug in the implementation!
The code for protecting the stack has to run on the CPU thread, since
it's the CPU thread's stack we want to protect, but it was actually
running on EmuThread. This commit fixes that, since now this bug
matters on other operating systems too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This second stack leads to JNI problems on Android, because ART fetches
the address and size of the original stack using pthread functions
(see GetThreadStack in art/runtime/thread.cc), and (presumably) treats
stack addresses outside of the original stack as invalid. (What I don't
understand is why some JNI operations on the CPU thread work fine
despite this but others don't.)

Instead of creating a second stack, let's borrow the approach ART uses:
Use pthread functions to find out the stack's address and size, then
install guard pages at an appropriate location. This lets us get rid
of a workaround we had in the MsgAlert function.

Because we're no longer choosing the stack size ourselves, I've made some
tweaks to where the put the guard pages. Previously we had a stack of
2 MiB and a safe zone of 512 KiB. We now accept stacks as small as 512 KiB
(used on macOS) and use a safe zone of 256 KiB. I feel like this should
be fine, but haven't done much testing beyond "it seems to work".

By the way, on Windows it was already the case that we didn't create
a second stack... But there was a bug in the implementation!
The code for protecting the stack has to run on the CPU thread, since
it's the CPU thread's stack we want to protect, but it was actually
running on EmuThread. This commit fixes that, since now this bug
matters on other operating systems too.
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: convert GPLv2+ license info to SPDX tags</title>
<updated>2021-07-05T02:35:56+00:00</updated>
<author>
<name>Pierre Bourdon</name>
<email>delroth@gmail.com</email>
</author>
<published>2021-07-05T01:22:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=e149ad4f0a9874f354221a7fc76d8f1841e47808'/>
<id>e149ad4f0a9874f354221a7fc76d8f1841e47808</id>
<content type='text'>
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reformat all the things. Have fun with merge conflicts.</title>
<updated>2016-06-24T08:43:46+00:00</updated>
<author>
<name>Pierre Bourdon</name>
<email>delroth@gmail.com</email>
</author>
<published>2016-06-24T08:43:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=3570c7f03a2aa90aa634f96c0af1969af610f14d'/>
<id>3570c7f03a2aa90aa634f96c0af1969af610f14d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Common: asterisks go against the type name</title>
<updated>2016-01-21T19:46:25+00:00</updated>
<author>
<name>mathieui</name>
<email>mathieui@mathieui.net</email>
</author>
<published>2016-01-21T19:46:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=78aa398e7c09adc4fb9318a4c497e8fd1bcd58ba'/>
<id>78aa398e7c09adc4fb9318a4c497e8fd1bcd58ba</id>
<content type='text'>
not the variable name
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
not the variable name
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread: Remove unused Barrier class</title>
<updated>2015-05-26T23:25:59+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2015-05-26T21:23:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=23c11b3f27e0815c03e80730f3cfbcbc9353a86a'/>
<id>23c11b3f27e0815c03e80730f3cfbcbc9353a86a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Set copyright year to when a file was created</title>
<updated>2015-05-25T11:22:31+00:00</updated>
<author>
<name>Tillmann Karras</name>
<email>tilkax@gmail.com</email>
</author>
<published>2015-05-24T04:55:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=30ebb2459eb97ba544547183854775df8460b475'/>
<id>30ebb2459eb97ba544547183854775df8460b475</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update license headers to GPLv2+</title>
<updated>2015-05-25T11:22:31+00:00</updated>
<author>
<name>Tillmann Karras</name>
<email>tilkax@gmail.com</email>
</author>
<published>2015-05-17T23:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=cefcb0ace9d363b3679b4e93bcc9ec05f1e5f4f8'/>
<id>cefcb0ace9d363b3679b4e93bcc9ec05f1e5f4f8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Minor consistency changes</title>
<updated>2015-01-12T20:18:18+00:00</updated>
<author>
<name>Stevoisiak</name>
<email>S.Vascellaro@gmail.com</email>
</author>
<published>2015-01-11T05:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=cb86db7b68481edf129a4bfcf6cd44a9a0f32ac8'/>
<id>cb86db7b68481edf129a4bfcf6cd44a9a0f32ac8</id>
<content type='text'>
Mostly small changes, like capitalization and spelling
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly small changes, like capitalization and spelling
</pre>
</div>
</content>
</entry>
<entry>
<title>Common: Get rid of StdConditionVariable, StdMutex, and StdThread.</title>
<updated>2014-08-17T03:33:19+00:00</updated>
<author>
<name>Lioncash</name>
<email>mathew1800@gmail.com</email>
</author>
<published>2014-08-14T05:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=d18d3e1f3ef788d764ff2110ee3d1aaad51a6479'/>
<id>d18d3e1f3ef788d764ff2110ee3d1aaad51a6479</id>
<content type='text'>
All of the compilers we support have support for these now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All of the compilers we support have support for these now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Common: Move the Event class to a separate file, and add tests for it. Fix includes everywhere to match this.</title>
<updated>2014-04-14T08:54:07+00:00</updated>
<author>
<name>Pierre Bourdon</name>
<email>delroth@gmail.com</email>
</author>
<published>2014-04-13T23:15:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=6bdcbad3e4488c85ae402dcb44f65005769c64b9'/>
<id>6bdcbad3e4488c85ae402dcb44f65005769c64b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
