MGR: Bug fixes for Linux

svn path=/trunk/boinc/; revision=18925
This commit is contained in:
Charlie Fenton 2009-08-27 01:46:20 +00:00
parent a49ba8c2e9
commit f989eba75a
8 changed files with 38 additions and 8 deletions

View File

@ -7254,3 +7254,15 @@ David 26 Aug 2009
sched/
sched_types.cpp,h
sched_send.cpp
Charlie 26 Aug 2009
MGR: Bug fixes for Linux.
clientgui/
AsyncRPC.cpp
BOINCBaseView.cpp
BOINCClientManager.cpp
MainDocument.cpp,.h
sg_DlgMessages.cpp
ViewMessages.cpp

View File

@ -361,7 +361,7 @@ void *RPCThread::Entry() {
#endif // ifndef NO_PER_THREAD_LOCALE
m_pRPC_Thread_Mutex->Lock();
m_pDoc->m_bRPCThreadIsReady = true;
while(true) {
// Wait for main thread to wake us
// This does the following:

View File

@ -295,9 +295,10 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) {
if (iDocCount > 0) {
SynchronizeCache();
if (_EnsureLastItemVisible() && (iDocCount != iCacheCount)) {
m_pListPane->EnsureVisible(iDocCount - 1);
if (iDocCount > 1) {
if (_EnsureLastItemVisible() && (iDocCount != iCacheCount)) {
m_pListPane->EnsureVisible(iDocCount - 1);
}
}
if (m_pListPane->m_bIsSingleSelection) {

View File

@ -38,9 +38,9 @@ enum {
NewStyleDaemon = 1,
OldStyleDaemon
};
#endif
#ifdef __WXMSW__
#elif defined(__WXMSW__)
#include "win_util.h"
#include "diagnostics_win.h"
@ -52,6 +52,9 @@ EXTERN_C BOOL IsBOINCServiceStopping();
EXTERN_C BOOL IsBOINCServiceStopped();
EXTERN_C BOOL StartBOINCService();
EXTERN_C BOOL StopBOINCService();
#else
#include <sys/wait.h>
#endif
CBOINCClientManager::CBOINCClientManager() {
@ -155,6 +158,13 @@ bool CBOINCClientManager::IsBOINCCoreRunning() {
std::vector<PROCINFO> piv;
int retval;
if (m_lBOINCCoreProcessId) {
// Prevent client from being a zombie
if (waitpid(m_lBOINCCoreProcessId, 0, WNOHANG) == m_lBOINCCoreProcessId) {
m_lBOINCCoreProcessId = 0;
}
}
// Look for BOINC Client in list of all running processes
retval = procinfo_setup(piv);
if (retval) return false; // Should never happen

View File

@ -444,6 +444,7 @@ int CMainDocument::OnInit() {
m_bWaitingForRPC = false;
m_bNeedRefresh = false;
m_bNeedTaskBarRefresh = false;
m_bRPCThreadIsReady = false;
m_bShutDownRPCThread = false;
current_rpc_request.clear();
@ -472,6 +473,11 @@ int CMainDocument::OnInit() {
wxASSERT(!iRetVal);
m_RPCThread->Run();
for (int i=0; i<100; i++) {
if (!m_bRPCThreadIsReady) {
boinc_sleep(0.01); // Allow RPC thread to initialize itself
}
}
return iRetVal;
}

View File

@ -182,6 +182,7 @@ public:
wxDialog* GetRPCWaitDialog() { return m_RPCWaitDlg; }
// void TestAsyncRPC(); // For testing Async RPCs
RPCThread* m_RPCThread;
bool m_bRPCThreadIsReady;
bool m_bShutDownRPCThread;
private:

View File

@ -393,7 +393,7 @@ void CViewMessages::OnListRender (wxTimerEvent& event) {
}
}
if ((iRowCount) && (_EnsureLastItemVisible()) && (m_iPreviousRowCount != iRowCount)) {
if ((iRowCount>1) && (_EnsureLastItemVisible()) && (m_iPreviousRowCount != iRowCount)) {
m_pListPane->EnsureVisible(iRowCount - 1);
}

View File

@ -361,7 +361,7 @@ void CPanelMessages::OnRefresh() {
}
}
if ((iDocCount) && (EnsureLastItemVisible()) && (m_iPreviousDocCount != iDocCount)) {
if ((iDocCount > 1) && (EnsureLastItemVisible()) && (m_iPreviousDocCount != iDocCount)) {
m_pList->EnsureVisible(iDocCount - 1);
}