mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
libc: extent vbox specific pthread_create API
Make it possible to adopt normal Genode::Threads for use within in a pthread environment. Issue #3164.
This commit is contained in:
parent
2f33d44713
commit
5bab5f4cca
@ -948,6 +948,7 @@ _ZN16Pthread_registry6insertEP7pthread T
|
||||
_ZN16Pthread_registry6removeEP7pthread T
|
||||
_ZN16Pthread_registry8containsEP7pthread T
|
||||
_ZN4Libc14pthread_createEPP7pthreadPFPvS3_ES3_mPKcPN6Genode11Cpu_sessionENS8_8Affinity8LocationE T
|
||||
_ZN4Libc14pthread_createEPP7pthreadRN6Genode6ThreadE T
|
||||
|
||||
#
|
||||
# Libc plugin interface
|
||||
|
@ -37,6 +37,18 @@ int Libc::pthread_create(pthread_t *thread,
|
||||
}
|
||||
|
||||
|
||||
int Libc::pthread_create(pthread_t *thread, Genode::Thread &t)
|
||||
{
|
||||
pthread_t thread_obj = new pthread(t);
|
||||
|
||||
if (!thread_obj)
|
||||
return EAGAIN;
|
||||
|
||||
*thread = thread_obj;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
||||
|
@ -21,4 +21,6 @@ namespace Libc {
|
||||
void *(*start_routine) (void *), void *arg,
|
||||
size_t stack_size, char const * name,
|
||||
Genode::Cpu_session * cpu, Genode::Affinity::Location location);
|
||||
|
||||
int pthread_create(pthread_t *, Genode::Thread &);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user