summaryrefslogtreecommitdiff
path: root/Libraries/LibPthread/pthread.h
AgeCommit message (Collapse)Author
2020-09-25Meta+LibHTTP through LibWeb: Make clang-format-10 cleanBen Wiederhake
2020-07-21LibPThread: Make pthread_exit a noreturn functionMuhammad Zahalqa
LibPThread: mark pthread_exit a noreturn function using compiler attributes LibThread: remove a call to pthread_exit from Thread::start lambda expression as it make the return of teh lambda unreachable.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-11LibPthread: Fix incompatible pthread_setname_np(), pthread_getname_np()Andreas Kling
Other implementations of pthread_setname_np() do not take the name length as an argument. For pthread_getname_np(), other implementations take the buffer size as a size_t. This patch brings us in line with other implementations.
2019-12-25Kernel+LibPthread+LibC: Add a naive futex and use it for pthread_cond_tAndreas Kling
This patch implements a simple version of the futex (fast userspace mutex) API in the kernel and uses it to make the pthread_cond_t API's block instead of busily sched_yield(). An arbitrary userspace address is passed to the kernel as a "token" that identifies the futex and you can then FUTEX_WAIT and FUTEX_WAKE that specific userspace address. FUTEX_WAIT corresponds to pthread_cond_wait() and FUTEX_WAKE is used for pthread_cond_signal() and pthread_cond_broadcast(). I'm pretty sure I'm missing something in this implementation, but it's hopefully okay for a start. :^)
2019-12-22LibPthread+LibC: Support PTHREAD_MUTEX_RECURSIVEAndreas Kling
This allows SDL to build against our native recursive mutex instead of providing its own. Also it's just a nice feature to have. :^)
2019-12-08LibPThread: Add pthread_set/getname_npAndrew Kaster
These wrappers call the set_thread_name and get_thread_name syscalls respectively.
2019-12-07LibPthread: Add stubs for pthread_{get,set}schedparam()Andreas Kling
These should be the last thing needed to make SDL build with threads support. I think we can survive just fine with stubs of these for now, especially given that the kernel doesn't care super much about thread priorities anyway.
2019-12-07LibPthread: Implement condition variablesAndreas Kling
This feels like a pretty naive implementation, but I think it can work. Basically each waiter creates an object on its stack that is then added to a linked list inside by the pthread_cond_t. Signalling is then done by walking the list and unsetting the "waiting" flag on as many of the waiters as you like.
2019-12-01LibPthread: Remove some duplicate declarations in pthread.hAndreas Kling
2019-11-18Kernel+LibPthread: pthread_create handles pthread_attr_tAndrew Kaster
Add an initial implementation of pthread attributes for: * detach state (joinable, detached) * schedule params (just priority) * guard page size (as skeleton) (requires kernel support maybe?) * stack size and user-provided stack location (4 or 8 MB only, must be aligned) Add some tests too, to the thread test program. Also, LibC: Move pthread declarations to sys/types.h, where they belong.
2019-11-16LibPthread: Implement a basic first pthread mutexAndreas Kling
This patch adds these API's: - pthread_mutex_init() - pthread_mutex_lock() - pthread_mutex_unlock() No mutex attributes are supported yet, so we only do the simplest mutex wihout recursive locking.
2019-11-13LibPthread: Start working on a POSIX threading libraryAndreas Kling
This patch adds pthread_create() and pthread_exit(), which currently simply wrap our existing create_thread() and exit_thread() syscalls. LibThread is also ported to using LibPthread.