summaryrefslogtreecommitdiffstats
path: root/core/os/thread.h
Commit message (Collapse)AuthorAgeFilesLines
* Add THREADS_ENABLED macro in order to compile Godot to run on the main threadAdam Scott2024-01-171-2/+62
|
* Use mingw-std-threads in MinGW buildsPedro J. Estébanez2023-11-181-1/+8
|
* Avoid interaction issues between resource loading threadsPedro J. Estébanez2023-05-101-1/+1
|
* Refactor Node ProcessingJuan Linietsky2023-05-091-0/+2
| | | | | | | | | | * Node processing works on the concept of process groups. * A node group can be inherited, run on main thread, or a sub-thread. * Groups can be ordered. * Process priority is now present for physics. This is the first steps towards implementing https://github.com/godotengine/godot-proposals/issues/6424. No threading or thread guards exist yet in most of the scene code other than Node. That will have to be added later.
* Fix thread IDs.Juan Linietsky2023-04-241-7/+17
| | | | | | | | | On Linux, thread IDs were not properly assigned with the current approach. The line: `std::thread new_thread(&Thread::callback, _thread_id_hash(thread.get_id()), p_settings, p_callback, p_user);` does not work because the thread ID is not assigned until the thread starts. This PR changes the behavior to use manually generated thread IDs. Additionally, if a thread is (or may have been created) outside Godot, the method `Thread::attach_external_thread` was added.
* Fix data races in startup/teardownmyaaaaaaaaa2023-03-061-1/+1
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Enhance portability of threadingPedro J. Estébanez2022-10-041-9/+10
|
* Remove NO_THREADS fallback code, Godot 4 requires thread supportRémi Verschelde2022-10-031-19/+2
| | | | | This also removes `OS::can_use_threads` from the public API since it's always true.
* Code quality: Fix header guards consistencyRémi Verschelde2022-07-251-0/+1
| | | | | Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
* Include platform_config.h in thread.cpp and thread.hBartłomiej T. Listwon2022-03-141-0/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix Platform Thread OverrideLucy2021-09-291-4/+5
|
* Allow for platform Thread implementation overrideLucy2021-09-161-0/+6
|
* Move caller_id init to Thread constructor to fix UWP build.bruvzg2021-03-091-0/+1
|
* Improve thread IDs to avoid collisions with threads not created by the Godot ↵bruvzg2021-03-071-2/+3
| | | | API.
* Modernize atomicsPedro J. Estébanez2021-02-181-1/+2
| | | | | | | | | | - Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* Modernize ThreadPedro J. Estébanez2021-01-291-17/+54
| | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-161-1/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-1/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-2/+2
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: Harmonize header guards to style guide [Core]Rémi Verschelde2020-03-251-1/+1
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Remove redundant author doc commentsIAmActuallyCthulhu2019-08-121-4/+0
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Makes all Godot API's methods Lower CaseIndah Sylvia2017-08-071-4/+4
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* Added function to notify ScriptLanguage when a thread is created/freed, ↵Juan Linietsky2016-06-251-3/+4
| | | | allows scripts to allocate a stack there via TLS
* remove trailing whitespaceHubert Jarosz2016-03-091-9/+9
|
* thread renamingAriel Manzur2016-01-311-3/+3
|
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* thread set nameAriel Manzur2015-12-171-1/+3
|
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* GODOT IS OPEN SOURCEJuan Linietsky2014-02-091-0/+89