Module: wine Branch: refs/heads/master Commit: c6ad0201f49e5d7b5efeddc2dacb148c2f0f0547 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=c6ad0201f49e5d7b5efeddc2...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jun 23 12:26:23 2006 +0200
wine-pthread: Set thread scope to force using kernel threads on Solaris.
---
loader/pthread.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/loader/pthread.c b/loader/pthread.c index 451d112..5c6632d 100644 --- a/loader/pthread.c +++ b/loader/pthread.c @@ -100,6 +100,7 @@ static int create_thread( struct wine_pt pthread_attr_init( &attr ); pthread_attr_setstacksize( &attr, info->stack_size ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); + pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread on Solaris */ if (pthread_create( &id, &attr, (void * (*)(void *))info->entry, info )) ret = -1; pthread_attr_destroy( &attr ); return ret; @@ -129,7 +130,11 @@ #endif
/* set pid and tid */ info->pid = getpid(); +#ifdef __sun + info->tid = pthread_self(); /* this should return the lwp id on solaris */ +#else info->tid = gettid(); +#endif }