Commit Graph

5 Commits

Author SHA1 Message Date
Andrew Kaster
2f439327ac LibThreading: Only set pthread name on Serenity
pthread_setname_np is a can of worms for portability. Linux, macOS,
and the BSDs all do it differently.

Also skip adding the tid as an inspectable Core::Object property on
systems where pthread_t is known to be a pointer.
2022-10-16 15:39:00 -06:00
kleines Filmröllchen
91913fba59 LibThreading: Add is_started state information to Thread
Users can now determine whether a thread has been started or not. A
started thread might also have already terminated.

Implementation note: We *could* detect this with pthread APIs maybe, but
this is much simpler.
2022-07-22 19:35:41 +01:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Spencer Dixon
48731e9f17 LibThreading: Add new detach() API to Thread
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-02 17:52:45 +02:00
Andreas Kling
b5d73c834f Userland: Rename LibThread => LibThreading
Also rename the "LibThread" namespace to "Threading"
2021-05-22 18:54:22 +02:00