summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibThreading
AgeCommit message (Collapse)Author
2021-07-09LibThreading: Rename Lock => MutexAndreas Kling
2021-07-09LibThreading: Remove unused "Lockable" classAndreas Kling
2021-07-07LibThreading: Use a condvar to signal the BackgroundAction threadAndreas Kling
Now that pthread_cond_t works correctly thanks to Sergey, we can use them to wake up the BackgroundAction worker thread instead of making a Unix pipe. :^)
2021-07-06LibThread: Fix formatting that was broken by the previous commitGunnar Beutner
2021-07-06LibThreading: Fix building the library on macOSGunnar Beutner
2021-07-05LibThreading: Reimplement Lock in terms of pthread_mutex_tAndreas Kling
This class was previously a spinlock that would call sys$donate() to donate its timeslice to whichever thread was holding the lock. Now that pthread_mutex_t has a fast path, let's implement Lock on top of that instead and get rid of the last remaining user of sys$donate().
2021-07-05LibThreading: Fix BackgroundAction result use-after-freeTom
We need to move the result out of the BackgroundAction object before posting the completion callback as there is a chance the BackgroundAction instance gets freed before the event loop runs our callback. Fixes #7641
2021-07-04LibThreading: Wake up the background worker thread when there's workAndreas Kling
The worker thread used for BackgroundAction was going to sleep for 1 second at a time (when there was nothing to do.) This made using background actions for anything interactive quite unresponsive since you had to wait up to 1 second before it even started on your task. We now use a simple Unix pipe to signal the worker thread that a new work item is available. This makes Assistant way more responsive when typing. :^)
2021-07-02LibThreading: Add new detach() API to ThreadSpencer Dixon
Sometimes you don't care about `joining()` the result of a thread. The underlying pthread implementation already existed for detaching and now we expose it to the higher level API.
2021-07-02LibThreading: Add ability to cancel ongoing BackgroundActionsSpencer Dixon
Handlers of the BackgroundAction are responsible for checking if the action has been cancelled and returning early.
2021-05-22Userland: Rename LibThread => LibThreadingAndreas Kling
Also rename the "LibThread" namespace to "Threading"