hrev52857 adds 2 changesets to branch 'master'
old head: 35758c70466ac6a2d581101a09c9e9ddc7f003f6
new head: f167d21adcea20341d2080cc307f405dad82803c
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=f167d21adcea+%5E35758c70466a
----------------------------------------------------------------------------
84e34948f608: WebPositive: Translate "No SSE2" window title, also.
f167d21adcea: runtime_loader: Use a RecursiveLocker instead of manually
unlocking.
No functional change intended.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
2 files changed, 18 insertions(+), 57 deletions(-)
src/apps/webpositive/BrowserApp.cpp | 12 +++----
src/system/runtime_loader/elf.cpp | 63 +++++++--------------------------
############################################################################
Commit: 84e34948f6086dc147629d1f9309f4641ba33b7f
URL: https://git.haiku-os.org/haiku/commit/?id=84e34948f608
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Feb 11 21:31:38 2019 UTC
WebPositive: Translate "No SSE2" window title, also.
----------------------------------------------------------------------------
diff --git a/src/apps/webpositive/BrowserApp.cpp
b/src/apps/webpositive/BrowserApp.cpp
index f05db24589..460fab9f98 100644
--- a/src/apps/webpositive/BrowserApp.cpp
+++ b/src/apps/webpositive/BrowserApp.cpp
@@ -90,9 +90,9 @@ BrowserApp::BrowserApp()
get_cpuid(&info, 1, 0);
if ((info.eax_1.features & (1 << 26)) == 0) {
- BAlert alert("No SSE2 support", B_TRANSLATE("Your CPU is too
old and "
- "does not support the SSE2 extensions, without which
WebPositive "
- "cannot run. We recommend installing NetSurf instead."),
+ BAlert alert(B_TRANSLATE("No SSE2 support"), B_TRANSLATE("Your
CPU is "
+ "too old and does not support the SSE2 extensions,
without which "
+ "WebPositive cannot run. We recommend installing
NetSurf instead."),
B_TRANSLATE("Darn!"));
alert.Go();
exit(-1);
@@ -133,7 +133,7 @@ BrowserApp::AboutRequested()
{
BAboutWindow* window = new BAboutWindow(kApplicationName,
kApplicationSignature);
-
+
// create the about window
const char* authors[] = {
@@ -234,7 +234,7 @@ BrowserApp::ReadyToRun()
fSettingsWindow = new SettingsWindow(settingsWindowFrame, fSettings);
BWebPage::SetDownloadListener(BMessenger(fDownloadWindow));
-
+
fConsoleWindow = new ConsoleWindow(consoleWindowFrame);
fCookieWindow = new CookieWindow(cookieWindowFrame,
fContext->GetCookieJar());
@@ -393,7 +393,7 @@ BrowserApp::QuitRequested()
* In that case we only need to save that one, which is already
archived */
BMessage* message = CurrentMessage();
BMessage windowMessage;
-
+
status_t ret = message->FindMessage("window", &windowMessage);
if (ret == B_OK) {
fSession->AddMessage("window", &windowMessage);
############################################################################
Revision: hrev52857
Commit: f167d21adcea20341d2080cc307f405dad82803c
URL: https://git.haiku-os.org/haiku/commit/?id=f167d21adcea
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Feb 11 21:35:07 2019 UTC
runtime_loader: Use a RecursiveLocker instead of manually unlocking.
No functional change intended.
----------------------------------------------------------------------------
diff --git a/src/system/runtime_loader/elf.cpp
b/src/system/runtime_loader/elf.cpp
index fb617260ee..c4fa305ee6 100644
--- a/src/system/runtime_loader/elf.cpp
+++ b/src/system/runtime_loader/elf.cpp
@@ -53,20 +53,6 @@ static uint32 sPreloadedImageCount = 0;
static recursive_lock sLock = RECURSIVE_LOCK_INITIALIZER(kLockName);
-static inline void
-rld_lock()
-{
- recursive_lock_lock(&sLock);
-}
-
-
-static inline void
-rld_unlock()
-{
- recursive_lock_unlock(&sLock);
-}
-
-
static const char *
find_dt_rpath(image_t *image)
{
@@ -431,7 +417,7 @@ load_program(char const *path, void **_entry)
KTRACE("rld: load_program(\"%s\")", path);
- rld_lock();
+ RecursiveLocker _(sLock);
// for now, just do stupid simple global locking
preload_images();
@@ -475,8 +461,6 @@ load_program(char const *path, void **_entry)
*_entry = (void *)(gProgramImage->entry_point);
- rld_unlock();
-
gProgramLoaded = true;
KTRACE("rld: load_program(\"%s\") done: entry: %p, id: %" B_PRId32 ,
path,
@@ -499,7 +483,6 @@ err:
gErrorMessage.Buffer(), gErrorMessage.ContentSize(), 0,
0);
}
_kern_loading_app_failed(status);
- rld_unlock();
return status;
}
@@ -517,7 +500,7 @@ load_library(char const *path, uint32 flags, bool addOn,
void** _handle)
KTRACE("rld: load_library(\"%s\", %#" B_PRIx32 ", %d)", path, flags,
addOn);
- rld_lock();
+ RecursiveLocker _(sLock);
// for now, just do stupid simple global locking
// have we already loaded this library?
@@ -526,7 +509,6 @@ load_library(char const *path, uint32 flags, bool addOn,
void** _handle)
// a NULL path is fine -- it means the global scope shall be
opened
if (path == NULL) {
*_handle = RLD_GLOBAL_SCOPE;
- rld_unlock();
return 0;
}
@@ -536,7 +518,6 @@ load_library(char const *path, uint32 flags, bool addOn,
void** _handle)
if (image) {
atomic_add(&image->ref_count, 1);
- rld_unlock();
KTRACE("rld: load_library(\"%s\"): already loaded: %"
B_PRId32,
path, image->id);
*_handle = image;
@@ -546,7 +527,6 @@ load_library(char const *path, uint32 flags, bool addOn,
void** _handle)
status = load_image(path, type, NULL, NULL, &image);
if (status < B_OK) {
- rld_unlock();
KTRACE("rld: load_library(\"%s\") failed to load container:
%s", path,
strerror(status));
return status;
@@ -582,8 +562,6 @@ load_library(char const *path, uint32 flags, bool addOn,
void** _handle)
remap_images();
init_dependencies(image, true);
- rld_unlock();
-
KTRACE("rld: load_library(\"%s\") done: id: %" B_PRId32, path,
image->id);
*_handle = image;
@@ -594,7 +572,6 @@ err:
dequeue_loaded_image(image);
delete_image(image);
- rld_unlock();
return status;
}
@@ -611,7 +588,7 @@ unload_library(void* handle, image_id imageID, bool addOn)
if (handle == RLD_GLOBAL_SCOPE)
return B_OK;
- rld_lock();
+ RecursiveLocker _(sLock);
// for now, just do stupid simple global locking
if (gInvalidImageIDs) {
@@ -694,7 +671,6 @@ unload_library(void* handle, image_id imageID, bool addOn)
}
}
- rld_unlock();
return status;
}
@@ -707,14 +683,12 @@ get_nth_symbol(image_id imageID, int32 num, char
*nameBuffer,
uint32 i;
image_t *image;
- rld_lock();
+ RecursiveLocker _(sLock);
// get the image from those who have been already initialized
image = find_loaded_image_by_id(imageID, false);
- if (image == NULL) {
- rld_unlock();
+ if (image == NULL)
return B_BAD_IMAGE_ID;
- }
// iterate through all the hash buckets until we've found the one
for (i = 0; i < HASHTABSIZE(image); i++) {
@@ -749,8 +723,6 @@ get_nth_symbol(image_id imageID, int32 num, char
*nameBuffer,
}
}
out:
- rld_unlock();
-
if (num != count)
return B_BAD_INDEX;
@@ -763,13 +735,11 @@ get_nearest_symbol_at_address(void* address, image_id*
_imageID,
char** _imagePath, char** _imageName, char** _symbolName, int32* _type,
void** _location, bool* _exactMatch)
{
- rld_lock();
+ RecursiveLocker _(sLock);
image_t* image = find_loaded_image_by_address((addr_t)address);
- if (image == NULL) {
- rld_unlock();
+ if (image == NULL)
return B_BAD_VALUE;
- }
bool exactMatch = false;
elf_sym* foundSymbol = NULL;
@@ -824,7 +794,6 @@ get_nearest_symbol_at_address(void* address, image_id*
_imageID,
*_location = NULL;
}
- rld_unlock();
return B_OK;
}
@@ -850,7 +819,7 @@ get_symbol(image_id imageID, char const *symbolName, int32
symbolType,
|| strcmp(symbolName, B_TERM_AFTER_FUNCTION_NAME) == 0)
return B_BAD_VALUE;
- rld_lock();
+ RecursiveLocker _(sLock);
// for now, just do stupid simple global locking
// get the image from those who have been already initialized
@@ -874,7 +843,6 @@ get_symbol(image_id imageID, char const *symbolName, int32
symbolType,
} else
status = B_BAD_IMAGE_ID;
- rld_unlock();
return status;
}
@@ -888,7 +856,7 @@ get_library_symbol(void* handle, void* caller, const char*
symbolName,
if (symbolName == NULL)
return B_BAD_VALUE;
- rld_lock();
+ RecursiveLocker _(sLock);
// for now, just do stupid simple global locking
if (handle == RTLD_DEFAULT || handle == RLD_GLOBAL_SCOPE) {
@@ -986,7 +954,6 @@ get_library_symbol(void* handle, void* caller, const char*
symbolName,
&inImage, _location);
}
- rld_unlock();
return status;
}
@@ -1001,19 +968,15 @@ get_next_image_dependency(image_id id, uint32 *cookie,
const char **_name)
if (_name == NULL)
return B_BAD_VALUE;
- rld_lock();
+ RecursiveLocker _(sLock);
image = find_loaded_image_by_id(id, false);
- if (image == NULL) {
- rld_unlock();
+ if (image == NULL)
return B_BAD_IMAGE_ID;
- }
dynamicSection = (elf_dyn *)image->dynamic_ptr;
- if (dynamicSection == NULL || image->num_needed <= searchIndex) {
- rld_unlock();
+ if (dynamicSection == NULL || image->num_needed <= searchIndex)
return B_ENTRY_NOT_FOUND;
- }
for (i = 0, j = 0; dynamicSection[i].d_tag != DT_NULL; i++) {
if (dynamicSection[i].d_tag != DT_NEEDED)
@@ -1024,12 +987,10 @@ get_next_image_dependency(image_id id, uint32 *cookie,
const char **_name)
*_name = STRING(image, neededOffset);
*cookie = searchIndex + 1;
- rld_unlock();
return B_OK;
}
}
- rld_unlock();
return B_ENTRY_NOT_FOUND;
}