# Conflicts:
#	indra/llwindow/llwindowwin32.cpp
meow-7.2.2
Ansariel 2023-01-04 15:30:47 +01:00
commit 0de318cb5e
7 changed files with 47 additions and 14 deletions

View File

@ -2,7 +2,7 @@
* @file
* @brief
*
* $LicenseInfo:firstyear=2022&license=fsviewerlgpl$
* $LicenseInfo:firstyear=2023&license=fsviewerlgpl$
* Phoenix Firestorm Viewer Source Code
* Copyright (C) 2020, The Phoenix Firestorm Project, Inc.
*

View File

@ -3539,7 +3539,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>canonical_repo</key>
<string>https://github.com/secondlife/viewer</string>
<key>copyright</key>
<string>Copyright (c) 2022, The Phoenix Firestorm Project, Inc.</string>
<string>Copyright (c) 2023, The Phoenix Firestorm Project, Inc.</string>
<key>description</key>
<string>Firestorm Viewer</string>
<key>license</key>

View File

@ -180,7 +180,7 @@ protected:
typedef QueueT queue_type;
QueueT mStorage;
U32 mCapacity;
bool mClosed;
std::atomic<bool> mClosed; // <FS:Beq/> Try harder to stop the compiler optimising the mClosed state inside the loops
boost::fibers::timed_mutex mLock;
typedef std::unique_lock<decltype(mLock)> lock_t;
@ -342,7 +342,13 @@ bool LLThreadSafeQueue<ElementT, QueueT>::pushIfOpen(T&& element)
return true;
// Storage Full. Wait for signal.
mCapacityCond.wait(lock1);
// <FS:Beq> [FIRE-32453][BUG-232971] Improve shutdown behaviour. Time bound the sleep
// mCapacityCond.wait(lock1);
// When the queue is full and the consuming thread has exited we would never wake up.
// For safety, we now wait max half a second then recheck close.
const auto timeout = std::chrono::milliseconds(500);
mCapacityCond.wait_for(lock1, timeout);
// </FS:Beq>
}
}

View File

@ -1008,9 +1008,12 @@ void LLWindowWin32::close()
// This causes WM_DESTROY to be sent *immediately*
if (!destroy_window_handler(mWindowHandle))
{
OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
mCallbacks->translateString("MBShutdownErr"),
OSMB_OK);
// <FS:Beq> Can't use a message box here because we're about to stop servicing the events.
// OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
// mCallbacks->translateString("MBShutdownErr"),
// OSMB_OK);
LL_INFOS("Window") << "Destroying Window failed" << LL_ENDL;
// </FS:Beq>
}
}
else
@ -1029,6 +1032,10 @@ void LLWindowWin32::close()
// operations we're asking. That's the last time WE should touch it.
mhDC = NULL;
mWindowHandle = NULL;
// <FS:Beq> [FIRE-32453][BUG-232971] close the related queues first to prevent spinning.
mFunctionQueue.close();
mMouseQueue.close();
// </FS:Beq>
mWindowThread->close();
}
@ -5072,8 +5079,14 @@ void LLWindowWin32::LLWindowWin32Thread::close()
for (auto& pair: mThreads)
{
LL_DEBUGS("ThreadPool") << mName << " waiting on thread " << pair.first << LL_ENDL;
// if mName does not contain the word Window
pair.second.join();
// As we cannot seem to rely on the clean and timely exit of the windows thread in ALL situations we apply a timeout.
std::future<void> f = std::async(std::launch::async, [&] { pair.second.join(); });
if (f.wait_until(std::chrono::steady_clock::now() + std::chrono::seconds(5)) == std::future_status::ready) {
LL_DEBUGS("ThreadPool") << mName << " joined normally." << LL_ENDL;
} else {
LL_WARNS("ThreadPool") << mName << " join timed out." << LL_ENDL;
// the specified time point was reached before the thread finished execution and could be joined
}
}
LL_DEBUGS("ThreadPool") << mName << " shutdown complete" << LL_ENDL;
}
@ -5088,7 +5101,10 @@ void LLWindowWin32::LLWindowWin32Thread::run()
{
sWindowThreadId = std::this_thread::get_id();
LogChange logger("Window");
// <FS:Beq> [FIRE-32453][BUG-232971] Improve shutdown behaviour.
try
{
// </FS:Beq>
initDX();
//as good a place as any to up the MM timer resolution (see ms_sleep)
@ -5169,7 +5185,18 @@ void LLWindowWin32::LLWindowWin32Thread::run()
}
#endif
}
logger.always("done - queue closed on windows thread.");// <FS:Beq/> extra debug for threaded window handler
// <FS:Beq> [FIRE-32453][BUG-232971] Improve shutdown behaviour.
}
catch (const std::exception& e)
{
logger.always("Windows thread exiting - Exception: ", e.what());
}
catch (...)
{
logger.always("Windows thread exiting - Exception: Unknown");
}
logger.always("done - queue closed on windows thread.");
// </FS:Beq>
//clean up DXGI/D3D resources
if (mDXGIAdapter)

View File

@ -2700,7 +2700,7 @@ if (DARWIN)
set(MACOSX_BUNDLE_BUNDLE_NAME "Firestorm")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2010-2022 The Phoenix Firestorm Project, Inc.")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2010-2023 The Phoenix Firestorm Project, Inc.")
set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "Firestorm.nib")
set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication")

View File

@ -3,4 +3,4 @@
CFBundleName = "Firestorm";
CFBundleShortVersionString = "Firestorm version %%VERSION%%";
CFBundleGetInfoString = "Firestorm version %%VERSION%%, Copyright 2010-2022 The Phoenix Firestorm Project, Inc.";
CFBundleGetInfoString = "Firestorm version %%VERSION%%, Copyright 2010-2023 The Phoenix Firestorm Project, Inc.";

View File

@ -161,7 +161,7 @@ BEGIN
VALUE "FileDescription", "Firestorm"
VALUE "FileVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}"
VALUE "InternalName", "Firestorm"
VALUE "LegalCopyright", "Copyright \251 2010-2022, The Phoenix Firestorm Project, Inc."
VALUE "LegalCopyright", "Copyright \251 2010-2023, The Phoenix Firestorm Project, Inc."
VALUE "OriginalFilename", "Firestorm.exe"
VALUE "ProductName", "Firestorm"
VALUE "ProductVersion", "${VIEWER_VERSION_MAJOR}.${VIEWER_VERSION_MINOR}.${VIEWER_VERSION_PATCH}.${VIEWER_VERSION_REVISION}"