Commit 57343604 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

libwine: Call the Mac Multi-Processing Services lib from the main thread first.

parent bbb8c60c
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
#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>
#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"
/* 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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment