History log of /haiku/src/kits/app/InitTerminateLibBe.cpp
Revision Date Author Comments
# c5e4e4ff 01-Feb-2019 Augustin Cavalier <waddlesplash@gmail.com>

headers/kernel: Include declarations of initialization functions in image.h.

No "real" functional change, but this causes GCC7 to throw errors when
these functions are declared without the image_id argument, which
in some files they were (as this commit repairs.)

This change is largely inconsequential on x86, but on callee-cleanup-args
targets, leaving out the argument would probably cause stack corruption.


# 8a86ad75 09-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

libbe: Fixed current_team() to work after a fork.

* This allows to start a valid looper in the forked child, for example.


# 60f75e90 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# ef889769 29-Oct-2011 Axel Dörfler <axeld@pinc-software.de>

* Reinitialize global locks after a fork (at least those in the Application
Kit).
* This should fix #5668.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4701b640 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Give the BClipboard lock a name.
* be_clipboard is no longer created at libbe initialization time. The
BApplication creates it as done in BeOS. This requires manual
initialization in the registrar to avoid a deadlock on shutdown.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34388 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0b7c61c 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

Closing ticket #4465:
Net_server starts services by invoking fork() followed by exec(). If the latter
fails (for instance because the service isn't installed), the forked child is
invoking exit(). This in turn unloads libbe, triggering static cleanup code in
BMessage, which deletes a couple of message ports that were inherited from the
parent during the fork. After that, net_server was desparately missing those
ports and no longer worked reliably.
* in InitTerminateLibBe, we now register an atfork-(child-)handler, which
takes care to re-initialize the static reply ports used by BMessage code
* added BMessage::Private::StaticReInitForkedChild wrapper and
BMessage::_StaticReInitForkedChild() implementation which overwrites the
inherited port IDs with a set of own ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dbe170a 26-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented direct message passing for local targets; this fixes a deadlock
with PostMessage() in case the message queue is full.
Some notes:
* for synchronous replies, we don't use this mechanism yet, but it could be
extended to do that as well.
* the code looks so complicated because we need a way to access the looper's
queue without locking it (to prevent deadlocks); like Dano's solution, I've
abused BTokenSpace to store a BDirectMessageTarget with a BHandler.
* we also need to decouple the lifetime of a looper's queue from its target,
as we cannot lock the looper, and therefore, can't guarantee it stays valid
as long as we're accessing it outside of BLooper.
* init_clipboard() now needs to be done after the global constructors have
been called - since sending messages now needs gDefaultTokens to be initialized.
Since this is done per image, it shouldn't cause any troubles, though.
* some minor cleanup, removed unused _msg_cache_cleanup_() and friends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e51 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534ef684 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned _init_message_(), _delete_message_(), and _clean_msg_cache_() into
proper private static BMessage members and made them accessible through
BMessage::Private. Got rid of unused _reconstruct_message_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac11568 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced _init_roster_() _delete_roster_() by static functions in BRoster::Private.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fa51856 12-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Use new init_clipboard() function which initializes the global be_clipboard at libbe init time.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10705 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9e500cb 25-Aug-2003 ejakowatz <ejakowatz@nowhere.fake>

Minor tweak to BHandler::UnlockLooper()
Added calls to _init_message_(), _delete_message_(), and
_msg_cache_cleanup() to InitTerminateLibBe.cpp
Finished first implementation of BMessage::SendReply(), BMessage::_send_(),
and BMessage::_send_message()
Add BMessage to app.src, removed BBlockCache from support.src.
New BMessage::Private class has functions for twiddling BMessage internals


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ed834e3 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a3a31e26 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added library initialization/termination functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@398 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8a86ad75938a5ec3988d8f0d7deed79f29d3e1c6 09-Jun-2015 Axel Dörfler <axeld@pinc-software.de>

libbe: Fixed current_team() to work after a fork.

* This allows to start a valid looper in the forked child, for example.


# 60f75e901ce3063c63441ac644dd0e55a17d5d09 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# ef88976995d531bab82cce00f0badfb65faa271a 29-Oct-2011 Axel Dörfler <axeld@pinc-software.de>

* Reinitialize global locks after a fork (at least those in the Application
Kit).
* This should fix #5668.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4701b640d9b716771495bbe3ab8c53f5a8f3ab99 30-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Give the BClipboard lock a name.
* be_clipboard is no longer created at libbe initialization time. The
BApplication creates it as done in BeOS. This requires manual
initialization in the registrar to avoid a deadlock on shutdown.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34388 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0b7c61c46c65f6cdc85c3b8240b282f2d045f49 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

Closing ticket #4465:
Net_server starts services by invoking fork() followed by exec(). If the latter
fails (for instance because the service isn't installed), the forked child is
invoking exit(). This in turn unloads libbe, triggering static cleanup code in
BMessage, which deletes a couple of message ports that were inherited from the
parent during the fork. After that, net_server was desparately missing those
ports and no longer worked reliably.
* in InitTerminateLibBe, we now register an atfork-(child-)handler, which
takes care to re-initialize the static reply ports used by BMessage code
* added BMessage::Private::StaticReInitForkedChild wrapper and
BMessage::_StaticReInitForkedChild() implementation which overwrites the
inherited port IDs with a set of own ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dbe170a694e59988263a752b746b6a82a5ff277 26-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented direct message passing for local targets; this fixes a deadlock
with PostMessage() in case the message queue is full.
Some notes:
* for synchronous replies, we don't use this mechanism yet, but it could be
extended to do that as well.
* the code looks so complicated because we need a way to access the looper's
queue without locking it (to prevent deadlocks); like Dano's solution, I've
abused BTokenSpace to store a BDirectMessageTarget with a BHandler.
* we also need to decouple the lifetime of a looper's queue from its target,
as we cannot lock the looper, and therefore, can't guarantee it stays valid
as long as we're accessing it outside of BLooper.
* init_clipboard() now needs to be done after the global constructors have
been called - since sending messages now needs gDefaultTokens to be initialized.
Since this is done per image, it shouldn't cause any troubles, though.
* some minor cleanup, removed unused _msg_cache_cleanup_() and friends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e519c0447147b1d8b54a324bb7fedd3a606 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534ef684d970a6b8fdd6bd273b0ac00ffaa35433 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned _init_message_(), _delete_message_(), and _clean_msg_cache_() into
proper private static BMessage members and made them accessible through
BMessage::Private. Got rid of unused _reconstruct_message_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac115684801499291dc445d49c5b3ea6dfb738f 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Replaced _init_roster_() _delete_roster_() by static functions in BRoster::Private.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11033 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5fa518561e555fa54a2512dd32b1fc9299c25adf 12-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Use new init_clipboard() function which initializes the global be_clipboard at libbe init time.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10705 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9e500cb9eaa5061ac383f5093d08bbb65b142f8 25-Aug-2003 ejakowatz <ejakowatz@nowhere.fake>

Minor tweak to BHandler::UnlockLooper()
Added calls to _init_message_(), _delete_message_(), and
_msg_cache_cleanup() to InitTerminateLibBe.cpp
Finished first implementation of BMessage::SendReply(), BMessage::_send_(),
and BMessage::_send_message()
Add BMessage to app.src, removed BBlockCache from support.src.
New BMessage::Private class has functions for twiddling BMessage internals


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ed834e3f6f94d48d8671f8379040f4e8cc70238 08-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Cleaned up BRoster's friends mess. All access to private BRoster functionality is now done through the newly added BRoster::Private class, which is BRoster's only friend (poor BRoster ;-).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2664 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a3a31e261e742df90a33f67bae8fec02e8f6c334 23-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added library initialization/termination functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@398 a95241bf-73f2-0310-859d-f6bbb57e9c96