summaryrefslogtreecommitdiff
path: root/src/common/thread.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-10-20common: use SetThreadDescription API for thread namesGravatar Liam1-22/+2
2022-06-28Core: Fix tests.Gravatar Fernando Sahmkow1-2/+1
2022-06-28Core/Common: Corrections to core timing and add critical priority.Gravatar Fernando Sahmkow1-4/+9
2022-04-28chore: add missing SPDX tagsGravatar Andrea Pappacoda1-3/+3
Follow-up to 99ceb03a1cfcf35968cab589ea188a8c406cda52
2022-03-20general: Fix clang/gcc build errorsGravatar ameerj1-0/+1
2022-03-19common: Reduce unused includesGravatar ameerj1-1/+0
2021-09-11common: Move error handling to error.cpp/hGravatar Morph1-3/+3
This allows us to avoid implicitly including <string> every time common_funcs.h is included.
2020-08-05Fix thread naming on Linux, which limits names to 15 bytes.Gravatar comex1-0/+12
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and do nothing. - Also, add logging in case `pthread_set_name_np` returns an error anyway. This is Linux-specific, as the Apple and BSD versions of `pthread_set_name_np return `void`. - Change the name for CPU threads in multi-core mode from "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it fits into the Linux limit. Some other thread names are also cut off, but I didn't bother addressing them as you can guess them from the truncated versions. For a CPU thread, truncation means you can't see which core it is!
2020-06-27Clang Format.Gravatar Fernando Sahmkow1-15/+15
2020-06-27General: Tune the priority of main emulation threads so they have higher ↵Gravatar Fernando Sahmkow1-0/+46
priority than less important helper threads.
2020-06-27General: Recover Prometheus project from harddrive failure Gravatar Fernando Sahmkow1-0/+6
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
2020-04-01common: Port some changes from dolphin (#5127)Gravatar Vitor K1-6/+3
* IOFile: Make the move constructor and move assignment operator noexcept Certain parts of the standard library try to determine whether or not a transfer operation should either be a copy or a move. The prevalent notion of move constructors/assignment operators is that they should not throw, they simply move an already existing resource somewhere else. This is typically done with 'std::move_if_noexcept'. Like the name says, if a type's move constructor is noexcept, then the functions retrieves an r-value reference (for move semantics), or an l-value (for copy semantics) if it is not noexcept. As IOFile deletes the copy constructor and copy assignment operators, using IOFile with certain parts of the standard library can fail in unexcepted ways (especially when used with various container implementations). This prevents that. * fix various instances of -1 being assigned to unsigned types * do not assign in conditional statements * File/IOFile: Check _tfopen_s properly * common/file_util.cpp: address review comments Co-authored-by: Lioncash <mathew1800@gmail.com> Co-authored-by: Shawn Hoffman <godisgovernment@gmail.com> Co-authored-by: Sepalani <sepalani@hotmail.fr>
2019-03-29common/thread: Remove unused functionsGravatar Lioncash1-37/+0
Many of these functions are carried over from Dolphin (where they aren't used anymore). Given these have no use (and we really shouldn't be screwing around with OS-specific thread scheduler handling from the emulator, these can be removed. The function for setting the thread name is left, however, since it can have debugging utility usages.
2018-11-22common/thread: Drop Hungarian notation on SetCurrentThreadName's parameterGravatar Lioncash1-7/+7
This is inconsistent with our coding style.
2018-11-21common/thread: Remove SleepCurrentThread()Gravatar Lioncash1-11/+0
This is also unused and superceded by standard functionality. The standard library provides std::this_thread::sleep_for(), which provides a much more flexible interface, as different time units can be used with it.
2018-11-21common/thread: Remove unused CurrentThreadId()Gravatar Lioncash1-10/+0
This is an old function that's no longer necessary. C++11 introduced proper threading support to the language and a thread ID can be retrieved via std::this_thread::get_id() if it's ever needed.
2016-12-05Support mingw cross-compileGravatar Jannik Vogel1-1/+1
2016-10-27common: only FreeBSD has thread affinity compatible with LinuxGravatar Jan Beich1-1/+5
src/common/thread.cpp:90:5: error: unknown type name 'cpu_set_t'; did you mean 'cpuset_t'? cpu_set_t cpu_set; ^~~~~~~~~ cpuset_t /usr/include/sys/_cpuset.h:48:24: note: 'cpuset_t' declared here typedef struct _cpuset cpuset_t; ^ 1 error generated.
2016-10-27common: define routines to set thread name on more BSDsGravatar Jan Beich1-2/+4
src/common/thread.cpp:123:5: error: use of undeclared identifier 'pthread_setname_np' pthread_setname_np(pthread_self(), szThreadName); ^ 1 error generated.
2016-09-21Remove empty newlines in #include blocks.Gravatar Emmanuel Gil Peyrot1-2/+0
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Sources: Run clang-format on everything.Gravatar Emmanuel Gil Peyrot1-48/+32
2015-06-28Common: Cleanup thread includes.Gravatar Emmanuel Gil Peyrot1-4/+13
2014-12-29Fix MSVC-related #defines and add CMakeLists commentGravatar darkf1-3/+3
2014-12-20License changeGravatar purpasmart961-2/+2
2014-11-28Fix MinGW buildGravatar darkf1-8/+15
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP ↵Gravatar Emmanuel Gil Peyrot1-3/+3
or generated
2014-09-08common: Prune all redundant includesGravatar archshift1-1/+0
2014-09-07Removed common/std_xyz, instead using the std headerGravatar archshift1-4/+2
2014-08-07Use pthread_set_name_np() on OpenBSD.Gravatar Anthony J. Bentley1-1/+3
2014-04-08fixed project includes to use new directory structureGravatar bunnei1-2/+2
2014-04-08got rid of 'src' folders in each sub-projectGravatar bunnei1-0/+0
2014-04-01convert tabs to spacesGravatar bunnei1-46/+46
2013-09-04replaced common code with dolphin commonGravatar ShizZy1-0/+133