summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Thread.h
AgeCommit message (Collapse)Author
2023-02-28Jit: Don't use a second stackJosJuice
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.
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-01-21Common: asterisks go against the type namemathieui
not the variable name
2015-05-26Thread: Remove unused Barrier classLioncash
2015-05-25Set copyright year to when a file was createdTillmann Karras
2015-05-25Update license headers to GPLv2+Tillmann Karras
2015-01-12Minor consistency changesStevoisiak
Mostly small changes, like capitalization and spelling
2014-08-16Common: Get rid of StdConditionVariable, StdMutex, and StdThread.Lioncash
All of the compilers we support have support for these now.
2014-04-14Common: Move the Event class to a separate file, and add tests for it. Fix ↵Pierre Bourdon
includes everywhere to match this.
2014-03-29Remove all trailing whitespaces from our codebase.Pierre Bourdon
2014-02-20Fix more header sorting issues in Common/ (now check-includes clean).Pierre Bourdon
2014-02-18Convert all includes to relative paths.Lioncash
2014-02-17Second and final pass of clearing out tabs.Lioncash
2014-02-10Replace all include guard ifdefs with "#pragma once"lioncash
2013-12-31Remove unnecessary Src/ foldersJasper St. Pierre