History log of /haiku/src/servers/app/MessageLooper.cpp
Revision Date Author Comments
# 399fe9fc 30-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Alphabetize new include in MessageLooper.


# 1bb19993 28-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Include malloc.h to appease GCC2.


# bae7a949 28-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

app_server: We must clone the name in MessageLooper().

A number of things that pass it in have it as a stack temporary.


# 565155af 27-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

Remove unnecessary usages of BLocker::Sem().

Most of these should have been BLocker::InitCheck() anyway.
The one that was actually using the sem (MessageLooper)
should just store the name parameter, which simplifies
things anyway.

Done as a result of a branch where I'm experimenting
with making BLocker not even create a semaphore in
"benaphore" mode.


# f744935b 04-Aug-2016 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed broken ServerApp allocation.

* Did not use std::nothrow, but exceptions were not catched.
* MessageLooper::Run() now returns a status code.
* There are a lot more cases of a new without nothrow that need to
be investigated.


# 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.


# 3fed1a15 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Get app_server working on x86_64.

With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.


# b9bedde4 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Assert the right lock, thanks Axel. Some clean up.



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


# a632458d 29-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

The wonders of signals:
* Since the app_server launched the input_server, it would also get notified
when the latter died via a signal - but LinkReceiver could return B_INTERRUPTED
in that case (it didn't check the return value of port_buffer_size()) which
the app_server misinterpreted and quit itself... this fixes the hanging part
of bug #1298.
* But the input_server still wasn't restarted, because the Registrar had it
still listed as being running. Now, the Registrar checks not just periodically
for died teams, it will also check for it when a new application registers
itself. This fixes the rest of bug #1298.
* Removed the old (disabled) R5 style input_server launch mechanism from the
app_server.
* MessageLooper now prints a bit more information when a port is supposed to
have been deleted.
* The default implementation of MessageLooper::_GetLooperName() is now
returning the name of the semaphore of its BLocker instead of "unnamed
looper".


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


# 19b0fb93 24-Mar-2007 Axel Dörfler <axeld@pinc-software.de>

The MessageLooper class did not initialize its fThread member, causing ServerWindow
to rename arbitrary threads. This fixes bug #1122.


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


# 5131b5bc 30-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

The window and application server threads now run at B_DISPLAY_PRIORITY, too; this
was a stupid oversight, and should improve the responsiveness of the UI under load
a lot. Thanks Stefano!


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


# b02ce811 12-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

You can now specify a timeout to MessageLooper::PostMessage().


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


# 67e79bf4 25-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

A message looper can now have a death semaphore, ServerWindow now uses them.
ServerApp now waits up to 3 seconds for windows before killing them - it now
waits on the death semaphore, and only kills a window if it didn't quit fast
enough.


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


# 770c05d6 25-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

The Desktop class now gets its own message processing loop: moved application
creation/deletion (and management) over to that class.
ServerApp now gets a desktop pointer, and no longer uses gDesktop.
Converted private MessageLooper::_MessagePort() to a public method MessagePort()
so that the looper can be addressed from elsewhere without using PostMessage().
Added a real basic message loop to MessageLooper::_MessageLoop().
BApplication now only asks the app_server to get its desktop object which should
now be used for everything that's not in the realm of the application.


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


# c6a25272 24-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Split ServerWindow::Quit() into two parts, and moved the generic one to
the MessageLooper class - the other part is called from there as virtual
_PrepareQuit().
Moved the class documentation to the source file.


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


# 89ab121e 23-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Factored a MessageLooper class out of ServerWindow and ServerApp. Could still
be improved a bit (Quit() and _MessageLooper() are empty right now).
Removed ServerApp::PingTarget().
Hopefully cleared some confusion about ServerApp::fClientLooperPort and fClientToken
(previously fHandlerToken), even if it's currently unused.


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


# 3fed1a15f58e8d6fe6b492f3b94bb3625ffeddbd 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Get app_server working on x86_64.

With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.


# b9bedde479b543dc53b5c4de100af2d4722419fd 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Assert the right lock, thanks Axel. Some clean up.



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


# a632458d8eb985eac127d127ac8e00d08e301d92 29-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

The wonders of signals:
* Since the app_server launched the input_server, it would also get notified
when the latter died via a signal - but LinkReceiver could return B_INTERRUPTED
in that case (it didn't check the return value of port_buffer_size()) which
the app_server misinterpreted and quit itself... this fixes the hanging part
of bug #1298.
* But the input_server still wasn't restarted, because the Registrar had it
still listed as being running. Now, the Registrar checks not just periodically
for died teams, it will also check for it when a new application registers
itself. This fixes the rest of bug #1298.
* Removed the old (disabled) R5 style input_server launch mechanism from the
app_server.
* MessageLooper now prints a bit more information when a port is supposed to
have been deleted.
* The default implementation of MessageLooper::_GetLooperName() is now
returning the name of the semaphore of its BLocker instead of "unnamed
looper".


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


# 19b0fb934cfdc0db761b715f3862902fd24e5485 24-Mar-2007 Axel Dörfler <axeld@pinc-software.de>

The MessageLooper class did not initialize its fThread member, causing ServerWindow
to rename arbitrary threads. This fixes bug #1122.


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


# 5131b5bcf6321688e67f149d95d2a7f670762548 30-Nov-2006 Axel Dörfler <axeld@pinc-software.de>

The window and application server threads now run at B_DISPLAY_PRIORITY, too; this
was a stupid oversight, and should improve the responsiveness of the UI under load
a lot. Thanks Stefano!


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


# b02ce81171a1f7c6f70af150f07d9d59ab9f0b01 12-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

You can now specify a timeout to MessageLooper::PostMessage().


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


# 67e79bf45aca758085d8272ba2c2c46415560361 25-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

A message looper can now have a death semaphore, ServerWindow now uses them.
ServerApp now waits up to 3 seconds for windows before killing them - it now
waits on the death semaphore, and only kills a window if it didn't quit fast
enough.


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


# 770c05d6cc602b2e545e2ccae5a17c576881dc9c 25-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

The Desktop class now gets its own message processing loop: moved application
creation/deletion (and management) over to that class.
ServerApp now gets a desktop pointer, and no longer uses gDesktop.
Converted private MessageLooper::_MessagePort() to a public method MessagePort()
so that the looper can be addressed from elsewhere without using PostMessage().
Added a real basic message loop to MessageLooper::_MessageLoop().
BApplication now only asks the app_server to get its desktop object which should
now be used for everything that's not in the realm of the application.


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


# c6a25272973999ab0f24dc010b70c7ea811fa35f 24-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Split ServerWindow::Quit() into two parts, and moved the generic one to
the MessageLooper class - the other part is called from there as virtual
_PrepareQuit().
Moved the class documentation to the source file.


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


# 89ab121e66e7cd6136e4e561805b85acea3d046a 23-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Factored a MessageLooper class out of ServerWindow and ServerApp. Could still
be improved a bit (Quit() and _MessageLooper() are empty right now).
Removed ServerApp::PingTarget().
Hopefully cleared some confusion about ServerApp::fClientLooperPort and fClientToken
(previously fHandlerToken), even if it's currently unused.


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