Triued in vain to fix threads segvs with gcc

Removed wxDebugStream


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-02 22:24:41 +00:00
parent 83624f7960
commit d524867f4c
15 changed files with 158 additions and 270 deletions

View File

@@ -16,17 +16,16 @@
#pragma interface "thread.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/object.h"
#include "wx/setup.h"
#include "wx/module.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
typedef enum {
typedef enum
{
wxMUTEX_NO_ERROR = 0,
wxMUTEX_DEAD_LOCK, // Mutex has been already locked by THE CALLING thread
wxMUTEX_BUSY, // Mutex has been already locked by ONE thread
@@ -34,7 +33,8 @@ typedef enum {
wxMUTEX_MISC_ERROR
} wxMutexError;
typedef enum {
typedef enum
{
wxTHREAD_NO_ERROR = 0, // No error
wxTHREAD_NO_RESOURCE, // No resource left to create a new thread
wxTHREAD_RUNNING, // The thread is already running
@@ -42,16 +42,25 @@ typedef enum {
wxTHREAD_MISC_ERROR // Some other error
} wxThreadError;
// defines the interval of priority.
/* defines the interval of priority. */
#define WXTHREAD_MIN_PRIORITY 0
#define WXTHREAD_DEFAULT_PRIORITY 50
#define WXTHREAD_MAX_PRIORITY 100
// ----------------------------------------------------------------------------
// GUI mutex handling.
// ----------------------------------------------------------------------------
void WXDLLEXPORT wxMutexGuiEnter();
void WXDLLEXPORT wxMutexGuiLeave();
// ----------------------------------------------------------------------------
// Mutex handler
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMutexInternal;
class WXDLLEXPORT wxMutex {
class WXDLLEXPORT wxMutex
{
public:
// constructor & destructor
wxMutex();
@@ -77,8 +86,10 @@ protected:
// ----------------------------------------------------------------------------
// Condition handler.
// ----------------------------------------------------------------------------
class wxConditionInternal;
class WXDLLEXPORT wxCondition {
class WXDLLEXPORT wxCondition
{
public:
// constructor & destructor
wxCondition();
@@ -100,8 +111,10 @@ private:
// ----------------------------------------------------------------------------
// Thread management class
// ----------------------------------------------------------------------------
class wxThreadInternal;
class WXDLLEXPORT wxThread {
class WXDLLEXPORT wxThread
{
public:
// constructor & destructor.
wxThread();
@@ -165,11 +178,20 @@ private:
};
// ----------------------------------------------------------------------------
// Global functions and variables
// Automatic initialization
// ----------------------------------------------------------------------------
// GUI mutex handling.
void WXDLLEXPORT wxMutexGuiEnter();
void WXDLLEXPORT wxMutexGuiLeave();
class wxThreadModule : public wxModule
{
DECLARE_DYNAMIC_CLASS(wxThreadModule)
public:
wxThreadModule() {}
virtual bool OnInit();
virtual void OnExit();
};
#endif // __THREADH__

View File

@@ -157,46 +157,6 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent
// Returns menu item id or -1 if none.
WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
// A debugging stream buffer.
// Under Windows, this writes to the Windows debug output.
// Under other platforms, it writes to cerr.
// ALl this horrible gubbins required for Borland, because the calling
// convention needs to be the same as for streambuf.
// Thanks to Gerhard.Vogt@embl-heidelberg.de for this solution.
#if defined(__BORLANDC__) && defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
#pragma option -po-
#endif
// Can't export a class derived from a non-export class
#if !defined(_WINDLL) && !defined(WXUSINGDLL)
// #ifdef new
// #undef new
// #endif
class WXDLLEXPORT wxDebugStreamBuf: public streambuf
{
public:
wxDebugStreamBuf(void);
~wxDebugStreamBuf(void) {}
int overflow(int i);
inline int underflow(void) { return EOF; }
int sync(void);
};
// #if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS
// #define new WXDEBUG_NEW
// #endif
#endif
#if defined(__BORLANDC__) && defined(__BCOPT__) && !defined(_RTL_ALLOW_po) && !defined(__FLAT__)
#pragma option -po.
#endif
/*
#if (!defined(__MINMAX_DEFINED) && !defined(max))
#define max(a,b) (((a) > (b)) ? (a) : (b))
@@ -204,6 +164,7 @@ class WXDLLEXPORT wxDebugStreamBuf: public streambuf
#define __MINMAX_DEFINED 1
#endif
*/
#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))