From 4a12ba89e7c683727eb489c0cc8fdfd2bd983916 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 22 Jul 2008 13:26:52 +0000 Subject: [PATCH] More fixes, Linux make files. svn path=/workspaces/charlief/; revision=15653 --- checkin_notes | 4 +++- clientgui/AsyncRPC.cpp | 12 ++++++++++-- clientgui/AsyncRPC.h | 2 +- clientgui/MainDocument.h | 2 +- clientgui/Makefile.am | 1 + clientgui/Makefile.linux.fedora | 1 + clientgui/Makefile.linux.suse | 1 + clientgui/Makefile.linux.ubuntu | 1 + 8 files changed, 19 insertions(+), 5 deletions(-) diff --git a/checkin_notes b/checkin_notes index 265b1267b6..7dd3a2a2c7 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5943,11 +5943,13 @@ David 21 July 2008 Charlie 21 July 2008 - MGR: async GUI RPCs: Fix RPC cancel, etc. for Windows. - - MGR: async GUI RPCs: Update XCode project to include AsyncRPC.cpp,h + - MGR: async GUI RPCs: Update XCode, makefile project to include + AsyncRPC.cpp,h. clientgui/ AsyncRPC.cpp MainDocument.cpp,.h + makefile.am mac_build/ boinc.xcodeproj/ project.pbxproj diff --git a/clientgui/AsyncRPC.cpp b/clientgui/AsyncRPC.cpp index d5e943b09d..e896e47518 100644 --- a/clientgui/AsyncRPC.cpp +++ b/clientgui/AsyncRPC.cpp @@ -235,11 +235,19 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request) { // start a new RPC thread. if (current_rpc_request.isActive) { current_rpc_request.isActive = false; +#if USE_CRITICAL_SECTIONS_FOR_ASYNC_RPCS + // Killing a thread while it is in a critical section + // usually causes an unrecoverable deadlock situation + m_critsect.Enter(); +#endif m_RPCThread->Pause(); // Needed on Windows rpc.close(); m_RPCThread->Kill(); #ifdef __WXMSW__ m_RPCThread->Delete(); // Needed on Windows, crashes on Mac/Linux +#endif +#if USE_CRITICAL_SECTIONS_FOR_ASYNC_RPCS + m_critsect.Leave(); #endif m_RPCThread = NULL; RPC_requests.clear(); @@ -436,7 +444,7 @@ void AsyncRPCDlg::OnRPCDlgTimer(wxTimerEvent& WXUNUSED(event)) { /// For testing: triggered by Advanced / Options menu item. void CMainDocument::TestAsyncRPC() { // TEMPORARY FOR TESTING ASYNC RPCs -- CAF -ALL_PROJECTS_LIST pl; + ALL_PROJECTS_LIST pl; ASYNC_RPC_REQUEST request; wxDateTime completionTime = wxDateTime((time_t)0); int retval = 0; @@ -456,7 +464,7 @@ ALL_PROJECTS_LIST pl; retval = RequestRPC(request); - wxString s = completionTime.Format("%X"); + wxString s = completionTime.FormatTime(); wxLogMessage(wxT("Completion time = %s"), s.c_str()); wxLogMessage(wxT("RequestRPC returned %d\n"), retval); } diff --git a/clientgui/AsyncRPC.h b/clientgui/AsyncRPC.h index af1a98461a..aa9f8dafec 100644 --- a/clientgui/AsyncRPC.h +++ b/clientgui/AsyncRPC.h @@ -162,4 +162,4 @@ END_DECLARE_EVENT_TYPES() -#endif // _ASYNCRPC_H_ \ No newline at end of file +#endif // _ASYNCRPC_H_ diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index f3bc513f46..3d5e19950a 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -27,7 +27,7 @@ #include #include "common_defs.h" #include "gui_rpc_client.h" -#include "asyncRPC.h" +#include "AsyncRPC.h" typedef struct { int slot; diff --git a/clientgui/Makefile.am b/clientgui/Makefile.am index 9fa1827380..54c7f261ed 100644 --- a/clientgui/Makefile.am +++ b/clientgui/Makefile.am @@ -34,6 +34,7 @@ boinc_gui_SOURCES = \ AdvancedFrame.cpp \ AlreadyAttachedPage.cpp \ AlreadyExistsPage.cpp \ + AsyncRPC.cpp \ BOINCBaseFrame.cpp \ BOINCBaseView.cpp \ BOINCBaseWizard.cpp \ diff --git a/clientgui/Makefile.linux.fedora b/clientgui/Makefile.linux.fedora index 357c82713d..13e86bad5f 100644 --- a/clientgui/Makefile.linux.fedora +++ b/clientgui/Makefile.linux.fedora @@ -70,6 +70,7 @@ OBJ = \ AccountManagerPropertiesPage.o \ AlreadyAttachedPage.o \ AlreadyExistsPage.o \ + AsyncRPC.o \ CompletionErrorPage.o \ CompletionPage.o \ NoInternetConnectionPage.o \ diff --git a/clientgui/Makefile.linux.suse b/clientgui/Makefile.linux.suse index f79ae9dfed..48334ac94b 100644 --- a/clientgui/Makefile.linux.suse +++ b/clientgui/Makefile.linux.suse @@ -70,6 +70,7 @@ OBJ = \ AccountManagerPropertiesPage.o \ AlreadyAttachedPage.o \ AlreadyExistsPage.o \ + AsyncRPC.o \ CompletionErrorPage.o \ CompletionPage.o \ NoInternetConnectionPage.o \ diff --git a/clientgui/Makefile.linux.ubuntu b/clientgui/Makefile.linux.ubuntu index 0de2a70ce5..3716dc2e3a 100644 --- a/clientgui/Makefile.linux.ubuntu +++ b/clientgui/Makefile.linux.ubuntu @@ -70,6 +70,7 @@ OBJ = \ AccountManagerPropertiesPage.o \ AlreadyAttachedPage.o \ AlreadyExistsPage.o \ + AsyncRPC.o \ CompletionErrorPage.o \ CompletionPage.o \ NoInternetConnectionPage.o \