mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibC: Make 'attributes' parameter for pthread_create const
This commit is contained in:
parent
ce4b66e908
commit
1b13d52a87
Notes:
sideshowbarker
2024-07-17 09:56:35 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/1b13d52a87 Pull-request: https://github.com/SerenityOS/serenity/pull/15764
2 changed files with 3 additions and 3 deletions
|
@ -121,13 +121,13 @@ static int create_thread(pthread_t* thread, void* (*entry)(void*), void* argumen
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_create.html
|
||||
int pthread_create(pthread_t* thread, pthread_attr_t* attributes, void* (*start_routine)(void*), void* argument_to_start_routine)
|
||||
int pthread_create(pthread_t* thread, pthread_attr_t const* attributes, void* (*start_routine)(void*), void* argument_to_start_routine)
|
||||
{
|
||||
if (!thread)
|
||||
return -EINVAL;
|
||||
|
||||
PthreadAttrImpl default_attributes {};
|
||||
PthreadAttrImpl** arg_attributes = reinterpret_cast<PthreadAttrImpl**>(attributes);
|
||||
PthreadAttrImpl* const* arg_attributes = reinterpret_cast<PthreadAttrImpl* const*>(attributes);
|
||||
|
||||
PthreadAttrImpl* used_attributes = arg_attributes ? *arg_attributes : &default_attributes;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
int pthread_create(pthread_t*, pthread_attr_t*, void* (*)(void*), void*);
|
||||
int pthread_create(pthread_t*, pthread_attr_t const*, void* (*)(void*), void*);
|
||||
void pthread_exit(void*) __attribute__((noreturn));
|
||||
int pthread_kill(pthread_t, int);
|
||||
void pthread_cleanup_push(void (*)(void*), void*);
|
||||
|
|
Loading…
Reference in a new issue