launch_daemon: Implemented sticky events, and registration.

* Sticky events are events that keep their signal raised, ie. even if
  a job is initialized afterwards, it will still be triggered.
* Consolidated naming for external events.
* Events are now registered once they are actually being used. This
  allows them to allocate the resources they need to do their thing.
This commit is contained in:
Axel Dörfler
2015-10-17 14:16:26 +02:00
parent 5ab2b1457b
commit 7cd19b7e5c
9 changed files with 178 additions and 58 deletions
+9 -2
View File
@@ -9,6 +9,12 @@
#include <Messenger.h>
// Flags for RegisterEvent()
enum {
B_STICKY_EVENT = 0x01
};
class BLaunchRoster {
public:
BLaunchRoster();
@@ -31,7 +37,7 @@ public:
status_t StartSession(const char* login);
status_t RegisterEvent(const BMessenger& source,
const char* name);
const char* name, uint32 flags);
status_t UnregisterEvent(const BMessenger& source,
const char* name);
status_t NotifyEvent(const BMessenger& source,
@@ -44,7 +50,8 @@ private:
void _InitMessenger();
status_t _UpdateEvent(uint32 what,
const BMessenger& source, const char* name);
const BMessenger& source, const char* name,
uint32 flags = 0);
private:
BMessenger fMessenger;