Skip to content

Commit c2e29e0

Browse files
authored
Implement some missing pthread stub functions (#18256)
* Add some musl pthreads files to the build that will be safe to run in singlethreaded pthreads stub mode as well. * Remove duplicate functions * Remove duplicate line
1 parent 6675055 commit c2e29e0

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

system/lib/pthread/library_pthread_stub.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ int pthread_getattr_np(pthread_t thread, pthread_attr_t *attr) {
287287
return 0;
288288
}
289289

290-
int pthread_attr_destroy(pthread_attr_t *attr) {
291-
return 0;
292-
}
293-
294290
int pthread_setcancelstate(int state, int* oldstate) {
295291
return 0;
296292
}
@@ -367,18 +363,6 @@ int pthread_spin_unlock(pthread_spinlock_t *lock) {
367363
return 0;
368364
}
369365

370-
int pthread_attr_setdetachstate(pthread_attr_t* attr, int detachstate) {
371-
return 0;
372-
}
373-
374-
int pthread_attr_setschedparam(pthread_attr_t* attr, const struct sched_param* param) {
375-
return 0;
376-
}
377-
378-
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) {
379-
return 0;
380-
}
381-
382366
int sem_init(sem_t *sem, int pshared, unsigned int value) {
383367
return 0;
384368
}

tools/system_libs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,21 @@ def get_files(self):
10151015
filenames=[
10161016
'pthread_self.c',
10171017
'pthread_cleanup_push.c',
1018+
'pthread_attr_destroy.c',
10181019
'pthread_attr_get.c',
1020+
'pthread_attr_setdetachstate.c',
1021+
'pthread_attr_setguardsize.c',
1022+
'pthread_attr_setinheritsched.c',
1023+
'pthread_attr_setschedparam.c',
1024+
'pthread_attr_setschedpolicy.c',
1025+
'pthread_attr_setscope.c',
1026+
'pthread_attr_setstack.c',
1027+
'pthread_attr_setstacksize.c',
1028+
'pthread_getconcurrency.c',
1029+
'pthread_getcpuclockid.c',
1030+
'pthread_getschedparam.c',
1031+
'pthread_setschedprio.c',
1032+
'pthread_setconcurrency.c',
10191033
# C11 thread library functions
10201034
'call_once.c',
10211035
'tss_create.c',

0 commit comments

Comments
 (0)