diff options
author | marha <marha@users.sourceforge.net> | 2010-04-02 13:46:21 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-04-02 13:46:21 +0000 |
commit | 0e9df5cfcee1ab569d7b41ea1af4eab3e31f099b (patch) | |
tree | 7f9e41630a661eaab39bef9023c2661a7281af96 /xorg-server/hw/xquartz/X11Application.m | |
parent | 8def4a30414ae76e228f285ccab8bba6de083d08 (diff) | |
download | vcxsrv-0e9df5cfcee1ab569d7b41ea1af4eab3e31f099b.tar.gz vcxsrv-0e9df5cfcee1ab569d7b41ea1af4eab3e31f099b.tar.bz2 vcxsrv-0e9df5cfcee1ab569d7b41ea1af4eab3e31f099b.zip |
svn merge -r522:HEAD ^/branches/released .
Diffstat (limited to 'xorg-server/hw/xquartz/X11Application.m')
-rw-r--r-- | xorg-server/hw/xquartz/X11Application.m | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m index 3faa1cb84..54066404e 100644 --- a/xorg-server/hw/xquartz/X11Application.m +++ b/xorg-server/hw/xquartz/X11Application.m @@ -52,7 +52,7 @@ #include <Xplugin.h> // pbproxy/pbproxy.h -extern BOOL xpbproxy_init (void); +extern int xpbproxy_run (void); #define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist" @@ -908,6 +908,26 @@ environment the next time you start X11?", @"Startup xinitrc dialog"); [X11App prefs_synchronize]; } +static inline pthread_t create_thread(void *func, void *arg) { + pthread_attr_t attr; + pthread_t tid; + + pthread_attr_init(&attr); + pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_create(&tid, &attr, func, arg); + pthread_attr_destroy(&attr); + + return tid; +} + +static void *xpbproxy_x_thread(void *args) { + xpbproxy_run(); + + fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n"); + return NULL; +} + void X11ApplicationMain (int argc, char **argv, char **envp) { NSAutoreleasePool *pool; @@ -962,8 +982,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) { */ check_xinitrc(); - if(!xpbproxy_init()) - fprintf(stderr, "Error initializing xpbproxy\n"); + create_thread(xpbproxy_x_thread, NULL); #if XQUARTZ_SPARKLE [[X11App controller] setup_sparkle]; |