From 3410caa6f2e1fd74d55f7a1717420bb2e1052b12 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 29 May 2010 23:48:47 +0200 Subject: Fixed the plugin termination. The master of a plugin will now wait for the plugin it kills to terminate. --- Hsbot/Irc/Types.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Hsbot/Irc/Types.hs') diff --git a/Hsbot/Irc/Types.hs b/Hsbot/Irc/Types.hs index fe70ea4..4b75085 100644 --- a/Hsbot/Irc/Types.hs +++ b/Hsbot/Irc/Types.hs @@ -3,6 +3,7 @@ module Hsbot.Irc.Types , IrcBotState (..) , IrcServer , IrcServerState (..) + , first ) where import Control.Concurrent @@ -22,7 +23,7 @@ type IrcBot = StateT IrcBotState IO -- | An Ircbot state data IrcBotState = IrcBotState { ircBotStartTime :: UTCTime -- the bot's uptime - , ircBotPlugins :: M.Map String (IrcPluginState, ThreadId) -- Loaded plugins + , ircBotPlugins :: M.Map String (IrcPluginState, MVar (), ThreadId) -- Loaded plugins , ircBotCommands :: M.Map String [String] -- Loaded plugins , ircBotChan :: Chan IrcBotMsg -- The IrcBot's communication channel , ircBotMasterChan :: Chan BotMsg -- The Hsbot communication channel @@ -44,3 +45,6 @@ data IrcServerState = IrcServerState , ircServerChan :: Chan IrcBotMsg -- the IrcBot channel } +-- | Utilities for triplets +first :: (a, b, c) -> a +first (a, _, _) = a -- cgit v1.2.3