Files
haiku-beta6/src/kits/app/AppServerLink.cpp
T
Marcus Overhagen 89bdf57382 assigned names to "some BLocker"s to aid debugging
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14702 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 16:54:21 +00:00

51 lines
1004 B
C++

/*
* Copyright 2001-2005, Haiku.
* Distributed under the terms of the MIT License.
*
* Authors:
* Erik Jaesler ([email protected])
* Axel Dörfler, [email protected]
*/
#include <Application.h>
#include <Locker.h>
#include <ApplicationPrivate.h>
#include <AppServerLink.h>
/** AppServerLink provides proxied access to the application's
* connection with the app_server.
* It has BAutolock semantics:
* creating one locks the app_server connection; destroying one
* unlocks the connection.
*/
static BLocker sLock("AppServerLink_sLock");
namespace BPrivate {
AppServerLink::AppServerLink(void)
{
sLock.Lock();
// if there is no be_app, we can't do a whole lot, anyway
if (be_app) {
fReceiver = &BApplication::Private::ServerLink()->Receiver();
fSender = &BApplication::Private::ServerLink()->Sender();
} else {
debugger("You need to have a valid app_server connection first!");
}
}
AppServerLink::~AppServerLink()
{
sLock.Unlock();
}
} // namespace BPrivate