mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
libwine: Call the Mac Multi-Processing Services lib from the main thread first.
This commit is contained in:
parent
bbb8c60c7e
commit
573436047e
@ -1,7 +1,7 @@
|
||||
DLLFLAGS = @DLLFLAGS@
|
||||
MODULE = libwine.$(LIBEXT)
|
||||
VERSCRIPT = $(srcdir)/wine.map
|
||||
EXTRALIBS = $(LIBPORT) @LIBDL@ @CRTLIBS@ @COREFOUNDATIONLIB@
|
||||
EXTRALIBS = $(LIBPORT) @LIBDL@ @CRTLIBS@ @COREFOUNDATIONLIB@ @CORESERVICESLIB@
|
||||
DEFS = -D__WINESRC__ -DWINE_UNICODE_API=""
|
||||
|
||||
VERSION = 1.0
|
||||
|
@ -39,21 +39,26 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <crt_externs.h>
|
||||
#define environ (*_NSGetEnviron())
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#define LoadResource MacLoadResource
|
||||
#define GetCurrentThread MacGetCurrentThread
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#undef LoadResource
|
||||
#undef GetCurrentThread
|
||||
#include <pthread.h>
|
||||
#else
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#define NONAMELESSSTRUCT
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wine/library.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <crt_externs.h>
|
||||
#define environ (*_NSGetEnviron())
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <pthread.h>
|
||||
#else
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
/* argc/argv for the Windows application */
|
||||
int __wine_main_argc = 0;
|
||||
char **__wine_main_argv = NULL;
|
||||
@ -756,6 +761,11 @@ static void apple_main_thread( void (*init_func)(void) )
|
||||
CFRunLoopSourceContext source_context = { 0 };
|
||||
CFRunLoopSourceRef source;
|
||||
|
||||
/* Multi-processing Services can get confused about the main thread if the
|
||||
* first time it's used is on a secondary thread. Use it here to make sure
|
||||
* that doesn't happen. */
|
||||
MPTaskIsPreemptive(MPCurrentTaskID());
|
||||
|
||||
/* Give ourselves the best chance of having the distributed notification
|
||||
* center scheduled on this thread's run loop. In theory, it's scheduled
|
||||
* in the first thread to ask for it. */
|
||||
|
Loading…
Reference in New Issue
Block a user