]> git.saurik.com Git - wxWidgets.git/commitdiff
thread support for mac finished
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 14 Aug 2000 08:15:51 +0000 (08:15 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 14 Aug 2000 08:15:51 +0000 (08:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/setup.h
include/wx/thread.h
include/wx_cw.pch
include/wx_cw.pch++
include/wx_cw_d.pch
include/wx_cw_d.pch++
samples/thread/makemac.mcp [new file with mode: 0644]

index bdbcba2aff28fd7680a7e2deeb95781041f80aa1..3469bdc814a1bc022f06670c62c497334c21cb6e 100644 (file)
@@ -1,8 +1,8 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        setup.h
 // Purpose:     Configuration for the library
-// Author:      AUTHOR
-// Modified by:
+// Author:      Stefan Csomor
+// Modified by: Stefan Csomor
 // Created:     ??/??/98
 // RCS-ID:      $Id$
 // Copyright:   (c) AUTHOR
                                   // if enabled, compiles built-in OS independent wxConfig
                                   // class and it's file (any platform) and registry (Win)
                                   // based implementations
-#define wxUSE_THREADS       0
+#define wxUSE_THREADS       1
                                   // support for multithreaded applications: if
                                   // 1, compile in thread classes (thread.h)
                                   // and make the library thread safe
index a4c4b465df675a18b85ff13a48f20618f7e07589..d4af63db350620da9e63286c6637b11a02da27c6 100644 (file)
@@ -150,11 +150,11 @@ class WXDLLEXPORT wxCriticalSectionInternal;
 
 // in order to avoid any overhead under platforms where critical sections are
 // just mutexes make all wxCriticalSection class functions inline
-#if !defined(__WXMSW__) && !defined(__WXPM__) && !defined(__WXMAC__)
+#if !defined(__WXMSW__) && !defined(__WXPM__)
     #define WXCRITICAL_INLINE   inline
 
     #define wxCRITSECT_IS_MUTEX 1
-#else // MSW || Mac || OS2
+#else // MSW || OS2
     #define WXCRITICAL_INLINE
 
     #define wxCRITSECT_IS_MUTEX 0
@@ -471,7 +471,7 @@ public:
     // wxApp then should block all "dangerous" messages
     extern bool WXDLLEXPORT wxIsWaitingForThread();
 #elif defined(__WXMAC__)
-    extern void WXDLLEXPORT wxMutexGuiLeaveOrEnter();
+   extern void WXDLLEXPORT wxMutexGuiLeaveOrEnter();
 
     // returns TRUE if the main thread has GUI lock
     extern bool WXDLLEXPORT wxGuiOwnedByMainThread();
@@ -482,6 +482,13 @@ public:
     // return TRUE if the main thread is waiting for some other to terminate:
     // wxApp then should block all "dangerous" messages
     extern bool WXDLLEXPORT wxIsWaitingForThread();
+
+    // implement wxCriticalSection using mutexes
+    inline wxCriticalSection::wxCriticalSection() { }
+    inline wxCriticalSection::~wxCriticalSection() { }
+
+    inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
+    inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
 #elif defined(__WXPM__)
     // unlock GUI if there are threads waiting for and lock it back when
     // there are no more of them - should be called periodically by the main
index 8a5a49d142321674d07d897398b9365b5bb80e94..2544b89085c7202c14217ad3b4e4656c57cbda78 100644 (file)
@@ -23,4 +23,9 @@
 #pragma once on
 #undef WX_PRECOMP
 #define wxUSE_GUI 1
+#define OLDP2C 1
 #include "wx/wx_cw_cm.h"
+#ifdef __WXMSW__
+    #include <windows.h>
+    #include "wx/msw/winundef.h"
+#endif
index a9f69244735bcc7d88022a08a94f91e0304665b0..7228505285fedf56fbad8936140cc5375c7f2856 100644 (file)
@@ -23,5 +23,6 @@
 #pragma once on
 #define WX_PRECOMP
 #define wxUSE_GUI 1
+#define OLDP2C 1
 #include "wx/wx_cw_cm.h"
 #include "wx/wxprec.h"
\ No newline at end of file
index a38cd139e540a9f1f0f0362a0569b8598b4915c5..9aa65032de4eaf5aacf7d2fedc8d7f4f833c7ae0 100644 (file)
@@ -18,6 +18,7 @@
 #undef WX_PRECOMP
 #define __WXDEBUG__ 1
 #define wxUSE_GUI 1
+#define OLDP2C 1
 #include "wx/wx_cw_cm.h"
 #ifdef __WXMSW__
     #include <windows.h>
index cb5643a468b785601ad15fd9f96c8ae8e8b4c411..20164b5ab3bb1eefa5bcb4210a94b06405a3d892 100644 (file)
@@ -16,8 +16,7 @@
 #define WX_PRECOMP
 #define __WXDEBUG__ 1
 #define wxUSE_GUI 1
-
-
+#define OLDP2C 1
 #include "wx/wx_cw_cm.h"
 #ifdef WX_PRECOMP
 #include "wx/wxprec.h"
diff --git a/samples/thread/makemac.mcp b/samples/thread/makemac.mcp
new file mode 100644 (file)
index 0000000..12218f1
Binary files /dev/null and b/samples/thread/makemac.mcp differ