Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4914/include

Modified Files:
        MApplication.h 
Log Message:
fixed reentrancy problems which occured when a folder update timer fired while the 
header retrieval progress dialog was opened

Index: MApplication.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MApplication.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -b -u -2 -r1.104 -r1.105
--- MApplication.h      19 Sep 2003 13:31:19 -0000      1.104
+++ MApplication.h      21 Apr 2004 17:42:13 -0000      1.105
@@ -221,4 +221,21 @@
    virtual bool AllowBgProcessing() const = 0;
 
+   /**
+      Start critical section inside which background processing should be
+      disallowed.
+
+      EnterCritical() is not reentrant, it is an error to call it if
+      AllowBgProcessing() already returns false.
+
+      Consider using MAppCriticalSection instead of manually calling
+      EnterCritical() and LeaveCritical().
+    */
+   virtual void EnterCritical() = 0;
+
+   /**
+      Leave critical section entered by EnterCritical().
+    */
+   virtual void LeaveCritical() = 0;
+
    //@}
 
@@ -582,4 +599,13 @@
 };
 
+/**
+   Call mApplication->EnterCritical() in ctor and LeaveCritical() in dtor.
+ */
+class MAppCriticalSection
+{
+public:
+   MAppCriticalSection() { mApplication->EnterCritical(); }
+   ~MAppCriticalSection() { mApplication->LeaveCritical(); }
+};
 
 /** A small class that locks the given Mutex during its existence. */



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to