diff options
author | Andrew Kaster <andrewdkaster@gmail.com> | 2019-11-17 20:08:10 -0700 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-18 09:04:32 +0100 |
commit | 618aebdd8ab55f9b63256e8195fa4e0f6fe305aa (patch) | |
tree | c076bbff894ee4f0151ae91049d62bad1e499d32 /Libraries/LibC | |
parent | aae26a3a1ec059ca16cb7930f4f78b908ec6e8a1 (diff) | |
download | serenity-618aebdd8ab55f9b63256e8195fa4e0f6fe305aa.zip |
Kernel+LibPthread: pthread_create handles pthread_attr_t
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.
Diffstat (limited to 'Libraries/LibC')
-rw-r--r-- | Libraries/LibC/limits.h | 2 | ||||
-rw-r--r-- | Libraries/LibC/sys/types.h | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Libraries/LibC/limits.h b/Libraries/LibC/limits.h index 1c5f583556..d89f7228ee 100644 --- a/Libraries/LibC/limits.h +++ b/Libraries/LibC/limits.h @@ -33,3 +33,5 @@ #define MB_LEN_MAX 16 #define ARG_MAX 65536 + +#define PTHREAD_STACK_MIN 65536 diff --git a/Libraries/LibC/sys/types.h b/Libraries/LibC/sys/types.h index cda19da382..9f7f3edab2 100644 --- a/Libraries/LibC/sys/types.h +++ b/Libraries/LibC/sys/types.h @@ -1,7 +1,7 @@ #pragma once -#include <stddef.h> #include <bits/stdint.h> +#include <stddef.h> #include <sys/cdefs.h> __BEGIN_DECLS @@ -60,4 +60,16 @@ struct utimbuf { time_t modtime; }; +typedef int pthread_t; +typedef void* pthread_key_t; +typedef void* pthread_once_t; +typedef uint32_t pthread_mutex_t; +typedef void* pthread_attr_t; +typedef void* pthread_mutexattr_t; +typedef void* pthread_cond_t; +typedef void* pthread_rwlock_t; +typedef void* pthread_rwlockatrr_t; +typedef void* pthread_spinlock_t; +typedef void* pthread_condattr_t; + __END_DECLS |