aboutsummaryrefslogtreecommitdiff
path: root/core/thread
Commit message (Collapse)AuthorAgeFilesLines
* removes the darwin specific paths from thread_unixLaytan Laats2025-11-071-15/+8
| | | | | | | | | | | I know I left a note there about deadlocks but it doesn't seem to happen anymore, especially now that the test runner creates cancellation points. Also, what was this `can_set_thread_cancel_state` for? It does not make sense to me that it enables cancellation, and then does it again later. With the comment it seems like it should be `.DISABLE` to first disable and then wait for the thread to start. But even that seems weird, why do you need to do that? I removed it.
* Change Odin's LICENSE to zlib from BSD 3-clausegingerBill2025-10-281-1/+1
| | | | This change was made in order to allow things produced with Odin and using Odin's core library, to not require the LICENSE to also be distributed alongside the binary form.
* Further overhaul of package line comments.Jeroen van Rijn2025-10-091-1/+1
|
* Add doc line to `core:thread`gingerBill2025-10-091-0/+1
|
* thread: set stack size to rlimitLaytan Laats2025-08-021-1/+6
|
* Expand `self_cleanup` documentation.Jeroen van Rijn2025-06-241-12/+24
|
* Fix early join after start.Jeroen van Rijn2025-06-212-13/+13
|
* fix: make pool_finish not hang when pool_start is not calledBruno Panuto2025-06-161-0/+14
|
* CommentJeroen van Rijn2025-06-121-1/+2
|
* Revert changes to thread_unix.odinJeroen van Rijn2025-06-121-7/+2
|
* Remove transmuteJeroen van Rijn2025-06-121-2/+2
|
* Remove c importJeroen van Rijn2025-06-121-1/+0
|
* Fix #5321Jeroen van Rijn2025-06-121-2/+7
|
* Fix #5321Jeroen van Rijn2025-06-121-2/+1
|
* 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
|