History log of /haiku/src/servers/registrar/Registrar.cpp
Revision Date Author Comments
# feeb4b5d 21-Dec-2019 Jérôme Duval <jerome.duval@gmail.com>

RosterPrivate: add IsShutDownInProgress()

enable to check whether a shutdown process is in progress.

Change-Id: I8efdddb3caa80e9fd188f202b6e92a888a7608e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2042
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 9edb207f 12-Jan-2019 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Fix for bug 6991, replace registrars timer tick

Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.

Change-Id: Ie69f9399cab41d2d492d469b5d3dc88e6080c15c
Reviewed-on: https://review.haiku-os.org/c/876
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# ffbedf60 16-Jan-2019 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Revert "Fix for bug 6991, replace registrars timer tick"

Unintentional commit, still not used to gerrit things

This reverts commit a02e4534f54232c4e85677cfe8451808f0b44209.


# a02e4534 12-Jan-2019 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Fix for bug 6991, replace registrars timer tick

Registrar schedules an event every second to do
fRoster-CheckSanity(). This uses 2.5% cpu on my machine
when idle. Changing it to five seconds lowers it to 0.1%

waddlesplash then pointed me to this bug which changes it
to watch for team deletion and call fRoster->CheckSanity()

As I know little in this area, it's mostly based on what
LaunchDaemon does in MessageRecieved.


# e3d73948 15-Aug-2015 Julian Harnath <julian.harnath@rwth-aachen.de>

app_server: fix test-app_server for launch_daemon changes

* Make test-app_server work again in a launch_daemon environment

* test_registrar gets a separate signature and port name again so the
host system can distinguish it from the system registrar

* AppServer is normally a BServer now, however, there can't be two
BApplications in one team. A class TestServerLoopAdapter is added,
which becomes the base class of AppServer instead of BServer when
compiling for libbe_test. It's an adapter class which looks towards
AppServer as it if was a BServer, but internally it is derived from
MessageLooper (like the old AppServer before the transition to
BServer).

This way, AppServer can stay a BServer in normal builds and it also
avoids having to use too many #ifdefs to distinguish the two
versions.


# bea38cb7 11-May-2015 Axel Dörfler <axeld@pinc-software.de>

registrar: implemented auth port via launch_daemon.

* get_roster_port_name() is no longer needed.
* This also removes the app_server restart code from the debug
server -- this will be done by the launch_daemon in the future.


# 1480e5da 02-Apr-2015 Axel Dörfler <axeld@pinc-software.de>

The beginnings of a launch_daemon for Haiku.

* This will be heavily inspired by Apple's launchd, as well as
systemd -- for now it really doesn't do a whole lot, though.
* What works so far: the configuration files are read, parsed, and
the jobs created.
* The jobs are even initialized, and their message ports created.
* BApplication now retrieves a previously created port from the
launch_daemon for use with BServer.
* Only the registrar actually uses this for now.


# 0690387c 26-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

BServer/BApplication: added constructor for looper name.

* Added an extra looperName argument to the private BApplication
constructor that BServer is using.
* This is now used to fix the ugliness that gave the registrar
a different looper name, and even saves a string comparison.


# 5c9672ed 17-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Add watching support for installation location package changes

Can be requested/stopped via BPackageRoster::{Start,Stop}Watching().
The notification message has the what code B_PACKAGE_UPDATE and contains
fields "event", "location", and "change count".


# 04209cdd 21-Jan-2012 czeidler <haiku@clemens-zeidler.de>

Catch a app_server crash in the debug server. Let the registrar restart the app_server and notify all apps.


# e09045d4 14-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* Fix debug build of the registrar.
* Make the macros use varargs so we avoid multiple invokations of the print
function (to properly use with debug_printf for example).
* Minor cleanup to the macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42848 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


# a0439d88 09-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Adjusted thread priorities of several system services based on a mail from
Mikhail Panasyuk: since worker threads often end up with B_NORMAL_PRIORITY,
it might be a good idea to give system threads a higher priority.
* Minor cleanup (mostly automatic whitespace).


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


# a94ce1c9 17-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reorganized the passwd and group support: A dedicated thread in the
registrar provides access to the DBs via a port message based
protocol. The functions in libroot just ask the registrar now.
* Added Linuxish shadow passwd support. No putspent() though -- we'll
provide private functions.


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


# 7301a7fb 13-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* The debug_server now sends the registrar messages whenever the debug alert
is shown, and also, if the user wants to debug the team.
* In the latter case, the registrar will now cancel a shutdown process.
* Also, it will now wait with the shutdown process until the user has
acknowledged the debugger alert.


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


# f2096210 15-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We catch exceptions in Registrar::MessageReceived() and main() and
invoke the debugger. At the moment the ultimate effect is the same as
before (the registrar terminates), but it does at least cause some
output in the serial debug output. And as soon as the scheduler and
keyboard stuff is fixed, I can commit my debug server changes and the
registrar should become debuggable.


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


# c2f641f2 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Turns out the whole "active app" mechanism in the registrar wasn't used at all; the
Switcher now works as expected.
* Renamed TRoster::ActivateApp() to UpdateActiveApp(), as the app is already activated
at that point (the registrar only keeps track of it).
* BWindow::DispatchMessage() now calls the new BRoster::Private::UpdateActiveApp()
method when it receives a B_WINDOW_ACTIVATED message.
* Added BRoster::_UpdateActiveApp() which calls the new B_REG_UPDATE_ACTIVE_APP.
* Removed now unused B_REG_ACTIVATE_APP.
* Minor cleanup.


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


# 6bfd06d1 31-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() eventually launches the application in question
in several steps:
1. early pre-registration with the registrar ("I wanna launch the
app, make sure noone interferes.")
2. load the app image
3. finish pre-registration with the registrar ("I have launched
the app, here is its team ID.")
4. start app main thread
5. send "on launch" messages to the app (argv, refs, others)

If the app is already running or being launched, 1. fails with a
conclusive error code and returns the team ID and the pre-registration
token of the app. Steps 2 - 4 are skipped and only the messages are
delivered using the team ID returned by 1.

This change fixes a race condition: The failed early pre-registration
request obviously cannot return the team ID, if the other thread
launching the app has not finished step 3 yet. Thus the argv/refs
message would not get delivered and Launch() would not return the
correct team ID.

Now we wait for the pre-registration to be finished in this case, using
the former _IsAppPreRegistered() mechanism, which already provided
such a waiting feature for one request. It has been extended to
accomodate an arbitrary number of waiting requests and renamed to
_IsAppRegistered().

This fixed bug #763.



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


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



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


# 310c813f 14-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Minor error output change.

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


# 54fce513 11-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Uninitialized member variable. The cause for the shutdown process sometimes not to start at all.

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


# 6b454d97 07-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Background applications are now ask to quit in parallel.
* Implemented handling of apps blocking on modal windows.
* Fixed a few bugs.


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


# 26ffd9e2 06-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing break in switch statement.

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


# 553ea301 03-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved TRoster out of the BPrivate namespace. It does no longer appear in
any public header.
* Replaced a good deal of the MessageDeliverer's DeliverMessage() versions
by more general ones using the new interface MessagingTargetSet to represent
a set of targets. This simplifies the usage in cases where the caller doesn't
already have the targets in a supported representation.
* Implemented a first approximation of the shutdown process. There is no
GUI yet. Only superficially tested under R5.


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


# 3c0a8158 28-Jun-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

The registrar now uses BServer instead of BApplication, which makes it
completely independent of the app server.



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


# 35d70f9e 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

The MessagingService is now a singleton. Added creation of the MessageDeliverer.


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


# 0a1eb226 23-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Start the messaging service. Due to missing kernel functionality the
initialization still fails.


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


# 769ba00e 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changes due to moving RegistrarDefs stuff into the BPrivate namespace.
* Rename the main thread after creating the BApplication. Then at least
the roster will be ready for use.


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


# dca399f4 14-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Use the BApplication constructor that returns an error code instead of the one that just exit()s on error, so that we can at least print the error.


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


# 32453e90 04-Jun-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the old, nicely working, DiskDevice API support from the registrar. We're going to reimplement it in the kernel.


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


# 2d2601d0 11-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented rescanning the device list. A few things, e.g. notifications and change counter updates, are still missing. Added a periodical rescan event.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2694 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


# 3f82d4f1 01-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a DiskDeviceManager to the registrar. Does nothing for now, but will soon be the one responsible for the disk device functionality in the registrar.


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


# 1bde02ae 08-Nov-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Fleshed out any missing pieces of BRoster::
- ClearRecent{Docs,Folders,Apps}
- AddToRecentApps()
- {Load,Save}RecentLists()


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


# 7c827740 27-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Added {Get,AddTo,Clear}Recent{Apps,Documents,Folders} cases to main message loop.


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


# 7a0335c8 18-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for roster watching.


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


# 56d4d637 15-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added handling for broadcast request (BRoster::Broadcast()).


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


# 463322c2 14-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added methods GetEventQueue() and App() (static). Added a sanity event for checking the roster for killed apps.


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


# 44c3726b 12-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added EventQueue and Event and MessageRunnerManager classes used for the
registrar side message runner support.


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


# af8eec40 07-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for the B_REG_SET_SIGNATURE request (BRoster::SetSignature()).


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


# afac6ebe 23-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Initialize the global be_roster for the registrar.


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


# 60aa4fea 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* Lock() the looper in application destructor. Otherwise RemoveHandler()
complains.
* Call the TRoster::Init() to add the registrar itself to the roster.


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


# 2ad75c74 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen comments and moved the initialization of child objects from
the constructor into ReadyToRun().


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


# 2e042baa 27-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added dispatching of the running app querying requests.


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


# c39e4532 26-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added dispatching of some now implemented roster requests.


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


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

Added TRoster instance to the registrar application and dispatching of the application registration messages.


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


# 4b8a7115 21-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a registrar skeleton.


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


# bea38cb711f29e929d62ceed9a0684e43c548a0d 11-May-2015 Axel Dörfler <axeld@pinc-software.de>

registrar: implemented auth port via launch_daemon.

* get_roster_port_name() is no longer needed.
* This also removes the app_server restart code from the debug
server -- this will be done by the launch_daemon in the future.


# 1480e5da6fc4a2926c3da1a973e39927ac2171ae 02-Apr-2015 Axel Dörfler <axeld@pinc-software.de>

The beginnings of a launch_daemon for Haiku.

* This will be heavily inspired by Apple's launchd, as well as
systemd -- for now it really doesn't do a whole lot, though.
* What works so far: the configuration files are read, parsed, and
the jobs created.
* The jobs are even initialized, and their message ports created.
* BApplication now retrieves a previously created port from the
launch_daemon for use with BServer.
* Only the registrar actually uses this for now.


# 0690387cd27bd8810040f7e2c0e539585df28ca1 26-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

BServer/BApplication: added constructor for looper name.

* Added an extra looperName argument to the private BApplication
constructor that BServer is using.
* This is now used to fix the ugliness that gave the registrar
a different looper name, and even saves a string comparison.


# 5c9672edebef5990fe9fc81fa917287448ac1ac4 17-Jun-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Add watching support for installation location package changes

Can be requested/stopped via BPackageRoster::{Start,Stop}Watching().
The notification message has the what code B_PACKAGE_UPDATE and contains
fields "event", "location", and "change count".


# 04209cdd81e0cc978a5da7a9c9a5175e11b4140c 21-Jan-2012 czeidler <haiku@clemens-zeidler.de>

Catch a app_server crash in the debug server. Let the registrar restart the app_server and notify all apps.


# e09045d41f067ea34a2fcefedb36c2b83ac4cb5d 14-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* Fix debug build of the registrar.
* Make the macros use varargs so we avoid multiple invokations of the print
function (to properly use with debug_printf for example).
* Minor cleanup to the macros.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42848 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


# a0439d88df9202e0a5aea9fbe587a1eaf88dd348 09-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Adjusted thread priorities of several system services based on a mail from
Mikhail Panasyuk: since worker threads often end up with B_NORMAL_PRIORITY,
it might be a good idea to give system threads a higher priority.
* Minor cleanup (mostly automatic whitespace).


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


# a94ce1c912808a0129c989f8d5c2e2aff4fec871 17-Apr-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Reorganized the passwd and group support: A dedicated thread in the
registrar provides access to the DBs via a port message based
protocol. The functions in libroot just ask the registrar now.
* Added Linuxish shadow passwd support. No putspent() though -- we'll
provide private functions.


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


# 7301a7fbdbd860cf12024a0274ba9fd440ae8c5b 13-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

bonefish+axeld:
* The debug_server now sends the registrar messages whenever the debug alert
is shown, and also, if the user wants to debug the team.
* In the latter case, the registrar will now cancel a shutdown process.
* Also, it will now wait with the shutdown process until the user has
acknowledged the debugger alert.


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


# f20962103f4371d9a6fa2c3510c2efb509df51ed 15-Feb-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

We catch exceptions in Registrar::MessageReceived() and main() and
invoke the debugger. At the moment the ultimate effect is the same as
before (the registrar terminates), but it does at least cause some
output in the serial debug output. And as soon as the scheduler and
keyboard stuff is fixed, I can commit my debug server changes and the
registrar should become debuggable.


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


# c2f641f2e51127c2318b5c4201919ec14ae9fe56 18-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Turns out the whole "active app" mechanism in the registrar wasn't used at all; the
Switcher now works as expected.
* Renamed TRoster::ActivateApp() to UpdateActiveApp(), as the app is already activated
at that point (the registrar only keeps track of it).
* BWindow::DispatchMessage() now calls the new BRoster::Private::UpdateActiveApp()
method when it receives a B_WINDOW_ACTIVATED message.
* Added BRoster::_UpdateActiveApp() which calls the new B_REG_UPDATE_ACTIVE_APP.
* Removed now unused B_REG_ACTIVATE_APP.
* Minor cleanup.


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


# 6bfd06d1ff129f4db4445b978fa3ee9257f239c9 31-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

BRoster::Launch() eventually launches the application in question
in several steps:
1. early pre-registration with the registrar ("I wanna launch the
app, make sure noone interferes.")
2. load the app image
3. finish pre-registration with the registrar ("I have launched
the app, here is its team ID.")
4. start app main thread
5. send "on launch" messages to the app (argv, refs, others)

If the app is already running or being launched, 1. fails with a
conclusive error code and returns the team ID and the pre-registration
token of the app. Steps 2 - 4 are skipped and only the messages are
delivered using the team ID returned by 1.

This change fixes a race condition: The failed early pre-registration
request obviously cannot return the team ID, if the other thread
launching the app has not finished step 3 yet. Thus the argv/refs
message would not get delivered and Launch() would not return the
correct team ID.

Now we wait for the pre-registration to be finished in this case, using
the former _IsAppPreRegistered() mechanism, which already provided
such a waiting feature for one request. It has been extended to
accomodate an arbitrary number of waiting requests and renamed to
_IsAppRegistered().

This fixed bug #763.



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


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



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


# 310c813fa89cc88bcff81cd81e864e20a4f69b47 14-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Minor error output change.

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


# 54fce5132604d48e090d538219e156b02807b62b 11-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Uninitialized member variable. The cause for the shutdown process sometimes not to start at all.

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


# 6b454d971de0b410c4194a1eea853d99be4321cc 07-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Background applications are now ask to quit in parallel.
* Implemented handling of apps blocking on modal windows.
* Fixed a few bugs.


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


# 26ffd9e208e5be71a6a7a7385b57cd80491eec70 06-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing break in switch statement.

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


# 553ea30124732e31346177c3bab544e074231b8e 03-Jul-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Moved TRoster out of the BPrivate namespace. It does no longer appear in
any public header.
* Replaced a good deal of the MessageDeliverer's DeliverMessage() versions
by more general ones using the new interface MessagingTargetSet to represent
a set of targets. This simplifies the usage in cases where the caller doesn't
already have the targets in a supported representation.
* Implemented a first approximation of the shutdown process. There is no
GUI yet. Only superficially tested under R5.


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


# 3c0a815896f95d6b2f4b7b5befda4e89f549b64e 28-Jun-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

The registrar now uses BServer instead of BApplication, which makes it
completely independent of the app server.



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


# 35d70f9ecaf41b1ff612077301a50f2b187a0729 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

The MessagingService is now a singleton. Added creation of the MessageDeliverer.


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


# 0a1eb226fbce35ed5875f8041124785b7808a909 23-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Start the messaging service. Due to missing kernel functionality the
initialization still fails.


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


# 769ba00e93ed6b83d3063653c140a16cde34c5af 17-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changes due to moving RegistrarDefs stuff into the BPrivate namespace.
* Rename the main thread after creating the BApplication. Then at least
the roster will be ready for use.


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


# dca399f4443ebaddbec0350017207d0a48686251 14-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Use the BApplication constructor that returns an error code instead of the one that just exit()s on error, so that we can at least print the error.


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


# 32453e90e0760eddaf450632f13677c7a3ec184b 04-Jun-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed the old, nicely working, DiskDevice API support from the registrar. We're going to reimplement it in the kernel.


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


# 2d2601d03c86b1b4c4cac1af7d971cead6642657 11-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Implemented rescanning the device list. A few things, e.g. notifications and change counter updates, are still missing. Added a periodical rescan event.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2694 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


# 3f82d4f1d24d199d2a6013e63b302422ec32ee56 01-Feb-2003 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a DiskDeviceManager to the registrar. Does nothing for now, but will soon be the one responsible for the disk device functionality in the registrar.


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


# 1bde02ae7b639be0ec8595ecec3577d7926a1f39 08-Nov-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Fleshed out any missing pieces of BRoster::
- ClearRecent{Docs,Folders,Apps}
- AddToRecentApps()
- {Load,Save}RecentLists()


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


# 7c82774099652449030b316e009b965a99bb2f87 27-Oct-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

Added {Get,AddTo,Clear}Recent{Apps,Documents,Folders} cases to main message loop.


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


# 7a0335c8a35bff97a843dff14eb85b70fa281483 18-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for roster watching.


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


# 56d4d6378e43042467e5f3245144da1e1be8afac 15-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added handling for broadcast request (BRoster::Broadcast()).


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


# 463322c288d57072a247f761444d0cd72b6cf8e0 14-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added methods GetEventQueue() and App() (static). Added a sanity event for checking the roster for killed apps.


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


# 44c3726b9d7e53a60e30e74df26efa5e8f7f9b50 12-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added EventQueue and Event and MessageRunnerManager classes used for the
registrar side message runner support.


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


# af8eec40804a3851d6820bacca1e456a14a48172 07-Oct-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added support for the B_REG_SET_SIGNATURE request (BRoster::SetSignature()).


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


# afac6ebecb43f5294220186c1aa45d7219a574a0 23-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Initialize the global be_roster for the registrar.


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


# 60aa4feab55f8044d59c194b488ad940c9055ea5 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

* Lock() the looper in application destructor. Otherwise RemoveHandler()
complains.
* Call the TRoster::Init() to add the registrar itself to the roster.


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


# 2ad75c74f98883917211d4859482ba8ec7fc9bf3 28-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added doxygen comments and moved the initialization of child objects from
the constructor into ReadyToRun().


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


# 2e042baa935bdf632aeb5b59981ac70fb7103b71 27-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added dispatching of the running app querying requests.


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


# c39e453222457c0c214f7663a8f90044424222d7 26-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added dispatching of some now implemented roster requests.


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


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

Added TRoster instance to the registrar application and dispatching of the application registration messages.


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


# 4b8a71155aa54849431a5d3fa9e76b9c8a3a0308 21-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Added a registrar skeleton.


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