ooo-build r14007 - in trunk: . patches/dev300



Author: jholesovsky
Date: Mon Sep 22 16:08:05 2008
New Revision: 14007
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14007&view=rev

Log:
2008-09-22  Jan Holesovsky  <kendy suse cz>

        * patches/dev300/fpicker-kde-less-threads.diff,
          patches/dev300/apply: Fix the KDE fpicker after the change of
          behavior intoduced in gnome-fpicker-main-thread.diff.


Added:
   trunk/patches/dev300/fpicker-kde-less-threads.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Sep 22 16:08:05 2008
@@ -1360,6 +1360,10 @@
 # Fix the KDE fpicker for 3layer OOo
 fpicker-kde-3layer.diff, n#413475, jholesov
 
+# Fix the KDE fpicker after the change of behavior intoduced in
+# gnome-fpicker-main-thread.diff, i#93366, cmc
+fpicker-kde-less-threads.diff, n#427336, jholesov
+
 
 [ AddressBooks ]
 

Added: trunk/patches/dev300/fpicker-kde-less-threads.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/fpicker-kde-less-threads.diff	Mon Sep 22 16:08:05 2008
@@ -0,0 +1,92 @@
+diff --git fpicker/source/unx/kde_unx/UnxCommandThread.hxx fpicker/source/unx/kde_unx/UnxCommandThread.hxx
+index d20321e..5fd62ee 100644
+--- fpicker/source/unx/kde_unx/UnxCommandThread.hxx
++++ fpicker/source/unx/kde_unx/UnxCommandThread.hxx
+@@ -86,10 +86,50 @@
+ #include <rtl/ustring.hxx>
+ #endif
+ 
++#include <vcl/svapp.hxx>
++
+ #include <list>
+ 
+ class UnxFilePickerNotifyThread;
+ 
++/** Synchronization for the 'thread-less' version of the fpicker.
++
++    Something like osl::Condition, but calls Application::Yield() while in
++    wait().
++*/
++class YieldingCondition
++{
++    ::osl::Mutex m_aMutex;
++    bool m_bValue;
++
++    bool get()
++    {
++        ::osl::MutexGuard aGuard( m_aMutex );
++        return m_bValue;
++    }
++
++public:
++    YieldingCondition() { reset(); }
++
++    void reset()
++    {
++        ::osl::MutexGuard aGuard( m_aMutex );
++        m_bValue = false;
++    }
++
++    void set()
++    {
++        ::osl::MutexGuard aGuard( m_aMutex );
++        m_bValue = true;
++    }
++
++    void wait()
++    {
++        while ( !get() )
++            Application::Yield();
++    }
++};
++
+ class UnxFilePickerCommandThread : public ::osl::Thread
+ {
+ protected:
+@@ -98,7 +138,7 @@ protected:
+ 
+     ::osl::Mutex                m_aMutex;
+ 
+-    ::osl::Condition            m_aExecCondition;
++    YieldingCondition           m_aExecCondition;
+     sal_Bool                    m_aResult;
+ 
+     ::osl::Condition            m_aGetCurrentFilterCondition;
+@@ -117,7 +157,7 @@ public:
+     UnxFilePickerCommandThread( UnxFilePickerNotifyThread *pNotifyThread, int nReadFD );
+     ~UnxFilePickerCommandThread();
+     
+-    ::osl::Condition& SAL_CALL  execCondition() { return m_aExecCondition; }
++    YieldingCondition& SAL_CALL execCondition() { return m_aExecCondition; }
+     sal_Bool SAL_CALL           result();
+ 
+     ::osl::Condition& SAL_CALL  getCurrentFilterCondition() { return m_aGetCurrentFilterCondition; }
+diff --git fpicker/source/unx/kde_unx/UnxFilePicker.cxx fpicker/source/unx/kde_unx/UnxFilePicker.cxx
+index 4590b74..16b2367 100644
+--- fpicker/source/unx/kde_unx/UnxFilePicker.cxx
++++ fpicker/source/unx/kde_unx/UnxFilePicker.cxx
+@@ -258,8 +258,12 @@ sal_Int16 SAL_CALL UnxFilePicker::execute()
+ {
+     checkFilePicker();
+ 
+-    sendCommand( ::rtl::OUString::createFromAscii( "exec" ),
+-                 m_pCommandThread->execCondition() );
++    // this is _not_ an osl::Condition, see i#93366
++    m_pCommandThread->execCondition().reset();
++    
++    sendCommand( ::rtl::OUString::createFromAscii( "exec" ) );
++
++    m_pCommandThread->execCondition().wait();
+ 
+     return m_pCommandThread->result();
+ }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]