summaryrefslogtreecommitdiff
path: root/src/dbus/server/session.h
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-03-19 09:23:37 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2012-05-08 09:14:09 +0200
commit18a4e2ea01f406b0ad7dff597eb51e91a64283b1 (patch)
tree0db0754641ec1b1054d5da3f5b1a4377b6a89c32 /src/dbus/server/session.h
parent7414fa0db87162e2891394bd856580bc7864efe3 (diff)
D-Bus server: cleaned up shutdown handling
Instead of scheduling a shutdown session, set a boolean flag and check that when scheduling/accepting new sessions and connections. That way it is a bit more obvious in which state the server is. Preventing shutdown when there is an auto sync config at startup is wrong. The auto sync flag might get removed later, in which case shutting down the server becomes okay again. The auto sync manager must take the shutdown lock as needed. Somehow that worked before, despite the "m_autoSync.preventTerm() ? -1 : duration". A test for this will be committed separately. Instead of coupling different modules directly to each other via method calls or callbacks, this commit introduces signals which are connected to methods as necessary when combining the different modules in the server.
Diffstat (limited to 'src/dbus/server/session.h')
-rw-r--r--src/dbus/server/session.h38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/dbus/server/session.h b/src/dbus/server/session.h
index a2379d81..1a203d35 100644
--- a/src/dbus/server/session.h
+++ b/src/dbus/server/session.h
@@ -180,7 +180,6 @@ class Session : public GDBusCXX::DBusObjectHelper,
OP_SYNC, /**< running a sync */
OP_RESTORE, /**< restoring data */
OP_CMDLINE, /**< executing command line */
- OP_SHUTDOWN, /**< will shutdown server as soon as possible */
OP_NULL /**< idle, accepting commands via D-Bus */
};
@@ -194,26 +193,6 @@ class Session : public GDBusCXX::DBusObjectHelper,
/** Cmdline to execute command line args */
boost::shared_ptr<CmdlineWrapper> m_cmdline;
- /**
- * time of latest file modification relevant for shutdown
- */
- Timespec m_shutdownLastMod;
-
- /**
- * timer which counts seconds until server is meant to shut down:
- * set only while the session is active and thus shutdown is allowed
- */
- Timeout m_shutdownTimer;
-
- /**
- * Called Server::SHUTDOWN_QUIESENCE_SECONDS after last file modification,
- * while shutdown session is active and thus ready to shut down the server.
- * Then either triggers the shutdown or restarts.
- *
- * @return always false to disable timer
- */
- bool shutdownServer();
-
/** Session.Attach() */
void attach(const GDBusCXX::Caller_t &caller);
@@ -298,8 +277,7 @@ public:
PRI_CMDLINE = -10,
PRI_DEFAULT = 0,
PRI_CONNECTION = 10,
- PRI_AUTOSYNC = 20,
- PRI_SHUTDOWN = 256 // always higher than anything else
+ PRI_AUTOSYNC = 20
};
/**
@@ -308,20 +286,6 @@ public:
void setPriority(int priority) { m_priority = priority; }
int getPriority() const { return m_priority; }
- /**
- * Turns session into one which will shut down the server, must
- * be called before enqueing it. Will wait for a certain idle period
- * after file modifications before claiming to be ready for running
- * (see Server::SHUTDOWN_QUIESENCE_SECONDS).
- */
- void startShutdown();
-
- /**
- * Called by server to tell shutdown session that a file was modified.
- * Session uses that to determine when the quiesence period is over.
- */
- void shutdownFileModified();
-
bool isServerAlerted() const { return m_serverAlerted; }
void setServerAlerted(bool serverAlerted) { m_serverAlerted = serverAlerted; }