diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-11-24 20:45:28 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-24 21:36:28 +0100 |
commit | 3ac0c9b9e73e44c5af5dd111fc7a0679f0caf706 (patch) | |
tree | e05379e0d433f159a282f3500a9a67da45f11d4a /Libraries/LibC | |
parent | f6f0d3cbaee541bef3897fb367f482b27b4f6056 (diff) | |
download | serenity-3ac0c9b9e73e44c5af5dd111fc7a0679f0caf706.zip |
LibPthread: Implement pthread_once()
The implementation uses atomics and futexes (yay!) and is heavily based on the
implementation I did for my learning project named "Let's write synchronization
primitives" [0].
That project, in fact, started when I tried to implement pthread_once() for
Serenity (because it was needed for another project of mine, stay tuned ;) ) and
was not very sure I got every case right. So now, after learning some more about
code patterns around atomics and futexes, I am reasonably sure, and it's time to
contribute the implementation of pthread_once() to Serenity :^)
[0] To be published at https://github.com/bugaevc/lets-write-sync-primitives
Diffstat (limited to 'Libraries/LibC')
-rw-r--r-- | Libraries/LibC/sys/types.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibC/sys/types.h b/Libraries/LibC/sys/types.h index feed6d358a..6de6b1feb1 100644 --- a/Libraries/LibC/sys/types.h +++ b/Libraries/LibC/sys/types.h @@ -78,7 +78,7 @@ struct utimbuf { typedef int pthread_t; typedef int pthread_key_t; -typedef void* pthread_once_t; +typedef int32_t pthread_once_t; typedef struct __pthread_mutex_t { uint32_t lock; |