aboutsummaryrefslogtreecommitdiff
path: root/core/thread
Commit message (Collapse)AuthorAgeFilesLines
* Early out and propagate `nil` in `create*`Jeroen van Rijn2025-04-171-13/+25
| | | | | If allocation of a `^Thread` failed, `create*` now properly return `nil`, so you can assert on that instead of calling `thread.destroy` on a null pointer, say.
* Fix #5049Jeroen van Rijn2025-04-171-2/+4
| | | | Keep in mind that `thread.create` needs an allocator to be set, as it returns `^Thread`.
* Use a proper Queue in thread.PoolWaqar Ahmed2024-11-301-8/+9
| | | | | With lots of tasks the dynamic array takes a big performance hit as its allocating all the time on pop_front
* fix thread_unix for Darwin after pthread corrections in posix packageLaytan Laats2024-10-301-4/+12
| | | | | | | | | | | | | | | | | | | | | | | afed3ce removed the sys/unix package and moved over to sys/posix, it has new bindings for the pthread APIs but should have been equivalent (not). 8fb7182 used `CANCEL_ENABLE :: 0`, `CANCEL_DISABLE :: 1`, `CANCEL_DEFERRED :: 0`, `CANCEL_ASYNCHRONOUS :: 1` for Darwin, while the correct values are `1`, `0`, `2` and `0` respectively (same mistake was made for FreeBSD in that commit). What this meant is that the `pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS)` was not actually successful, but because the error wasn't checked it was assumed it was. It also meant `pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)` would actually be setting `PTHREAD_CANCEL_DISABLE`. The code in this PR restores the behaviour by now actually deliberately setting `PTHREAD_CANCEL_DISABLE` and not setting `PTHREAD_CANCEL_ASYNCHRONOUS` which was the previous behaviour that does actually seem to work for some reason. (I also fixed an issue in fmt where `x` would use uppercase if it was a pointer.)
* remove pthread from sys/unix and use sys/posix where usedLaytan2024-10-281-30/+30
|
* Merge branch 'master' into file-tags-without-commentsKarl Zylinski2024-09-174-33/+18
|\
| * Fix data race when `pool_stop_task` is calledFeoramund2024-09-091-0/+1
| |
| * Use more atomic handling of thread flagsFeoramund2024-09-092-9/+9
| | | | | | | | This can prevent a data race on Linux with `Self_Cleanup`.
| * Convert POSIX `Thread` to use semaphore insteadFeoramund2024-09-091-12/+4
| | | | | | | | | | | | | | | | One less value to store, and it should be less of a hack too. Semaphores will not wait around if they have the go-ahead; they depend on an internal value being non-zero, instead of whatever was loaded when they started waiting, which is the case with a `Cond`.
| * Fix rare double-join possibility in POSIX `thread._join`Feoramund2024-09-091-12/+4
| | | | | | | | This was occuring about 1/100 times with the test runner's thread pool.
* | Moved all packages in core, base, vendor, tests and examples to use new #+ ↵Karl Zylinski2024-09-143-5/+5
|/ | | | file tag syntax.
* Fix thread sanitizer errors surfaced by tests/core/iopkova2024-09-031-2/+3
|
* fix zombie thread leak in thread self cleanupLaytan Laats2024-08-281-0/+3
|
* Merge pull request #4148 from Feoramund/tls-cleanergingerBill2024-08-262-2/+10
|\ | | | | Add API for freeing `thread_local` state
| * Add API for freeing `thread_local` stateFeoramund2024-08-262-2/+10
| |
* | Fix use-after-free in `thread.Pool`Feoramund2024-08-261-2/+6
|/
* [thread]: Document all functions in core:threadflysand72024-07-211-39/+242
|
* fix some bugs with -disable-assertLaytan Laats2024-07-161-3/+5
|
* wasi: make the demo run on wasi and run it in CILaytan Laats2024-06-295-48/+56
|
* Call `pthread_cancel` on Darwin, with advisory commentFeoramund2024-06-281-14/+17
|
* core/thread: fix a deadlock situation on unixLaytan Laats2024-06-071-11/+12
|
* Set thread pool `is_running` to false on shutdownFeoramund2024-06-021-0/+1
|
* Clear thread pool task data on restartFeoramund2024-06-021-0/+2
|
* Add task-stopping functionality to `thread.Pool`Feoramund2024-06-021-15/+115
|
* Merge pull request #3439 from andreas-jonsson/netbsdgingerBill2024-05-151-5/+5
|\ | | | | NetBSD support
| * Merge branch 'master' into netbsdAndreas T Jonsson2024-05-101-2/+2
| |\
| * | Fixed concurrency issueAndreas T Jonsson2024-04-181-2/+2
| | | | | | | | | | | | Fixed broken thread policy causing deadlocks.
| * | Updated core lib and did cleanupAndreas T Jonsson2024-04-181-2/+2
| | | | | | | | | | | | | | | Updated core with some path related functions and did some minor code cleanup. Most of the standard library function is just a matter of copy what is there for the other BSDs.
| * | Initial commit of NetBSD portAndreas T Jonsson2024-04-161-1/+1
| | |
* | | Fix hanging on `thread.join` for windows where the thread had not been `start`edgingerBill2024-05-131-1/+2
| | |
* | | Fix joining non-`Started` threads from blocking main threadFeoramund2024-05-102-2/+19
| |/ |/|
* | Fix discrepancy with pthread cancelability stateFeoramund2024-04-221-2/+2
|/
* Add `#no_broadcast` procedure parameter to disallow automatic array ↵gingerBill2024-03-211-1/+1
| | | | programming broadcasting on procedure arguments
* fix core:thread and a memory leakavanspector2024-02-271-4/+9
| | | | in the future probably native non-pthread implementation for haiku will be required
* Replace `core:*` to `base:*` where appropriategingerBill2024-01-285-6/+6
|
* stdcall -> systemgingerBill2024-01-171-1/+1
|
* Allow larger thread poly dataLaytan Laats2023-11-151-38/+55
| | | | | | | | The poly data currently has the restriction of being less than a pointer's size, but there is much more space in the `Thread.user_args` array which can be utilized, this commit allows you to pass types that are larger than pointer length as long as the total size of the poly data is less than that of the `Thread.user_args`.
* [core]: Remove `do` keyword from the core libraryflysand72023-11-111-6/+18
|
* Require parentheses for `#align(N)`gingerBill2023-08-151-1/+1
|
* Clean up usage of `using` throughout core and vendorgingerBill2023-07-311-2/+2
|
* Replace `x in &y` Use `&v in y` syntax through core & vendor for ↵gingerBill2023-06-261-1/+1
| | | | `switch`/`for` statements
* [core:thread] Seeing if this fixes network testshikari2023-06-074-34/+17
|
* [core:thread] Fix compilationhikari2023-06-072-0/+4
|
* [core:thread] Added `self_cleanup` flag to properly auto-clean threadshikari2023-06-073-99/+38
|
* [thread] Refactor handling of 'init_context' + add doc comments for itTetralux2023-06-033-22/+88
|
* Remove `thread.init_context = context`gingerBill2023-05-311-1/+0
|
* Changed js panics to unimplemented where sensibleDragos Popescu2023-03-221-8/+8
|
* Fixed more compile time errors when including os and thread to js targetsDragos Popescu2023-03-211-1/+1
|
* Made most libraries panic on js targets instead of not compilingDragos Popescu2023-03-201-0/+55
|
* Revert.Jeroen van Rijn2022-05-141-6/+7
|