BPicture: Fix archive constructor.
[haiku.git] / src / kits / app / AppServerLink.cpp
blobd0cc3c4bf642c03b1c422cf0b28265beb773b413
1 /*
2 * Copyright 2001-2005, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Erik Jaesler (erik@cgsoftware.com)
7 * Axel Dörfler, axeld@pinc-software.de
8 */
11 #include <Application.h>
12 #include <Locker.h>
14 #include <ApplicationPrivate.h>
15 #include <AppServerLink.h>
18 /** AppServerLink provides proxied access to the application's
19 * connection with the app_server.
20 * It has BAutolock semantics:
21 * creating one locks the app_server connection; destroying one
22 * unlocks the connection.
26 static BLocker sLock("AppServerLink_sLock");
29 namespace BPrivate {
31 AppServerLink::AppServerLink(void)
33 sLock.Lock();
35 // if there is no be_app, we can't do a whole lot, anyway
36 if (be_app) {
37 fReceiver = &BApplication::Private::ServerLink()->Receiver();
38 fSender = &BApplication::Private::ServerLink()->Sender();
39 } else {
40 debugger("You need to have a valid app_server connection first!");
45 AppServerLink::~AppServerLink()
47 sLock.Unlock();
50 } // namespace BPrivate