diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-07-13 16:02:50 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-07-13 16:02:50 +0100 |
commit | e140af144e987ff7f6d767f2dc48b9cf685803fd (patch) | |
tree | 4a01971890865b4b3ca837d563bc673cbb787de8 /lib/mauve/mauve_thread.rb | |
parent | d28af4ec946c6aa4b645b73cef47d7e0c680bc0d (diff) |
Big commit
* Added manpages for all binaries
* Added log-reopening for mauvealert-server, and logrotate snippet
* mauveserver now adds a user on install, and runs as that user
* Big logging tidy-up
* Alert subjects are only overwritten by the source, when the subject in the databse is empty
* Removed various attr_writer methods that were being redifined
* Added a notes box to the acknowledge form, but this doesn't work yet
Diffstat (limited to 'lib/mauve/mauve_thread.rb')
-rw-r--r-- | lib/mauve/mauve_thread.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/mauve/mauve_thread.rb b/lib/mauve/mauve_thread.rb index 79e742a..1aa8619 100644 --- a/lib/mauve/mauve_thread.rb +++ b/lib/mauve/mauve_thread.rb @@ -6,6 +6,7 @@ module Mauve class MauveThread def initialize + @thread = nil end def logger @@ -58,7 +59,7 @@ module Mauve end def frozen? - @frozen and @thread.stop? + defined? @frozen and @frozen and @thread.stop? end def thaw @@ -86,6 +87,10 @@ module Mauve @thread.is_a?(Thread) and @thread.alive? end + def stop? + @thread.is_a?(Thread) and @thread.stop? + end + def join(ok_exceptions=[]) @thread.join if @thread.is_a?(Thread) end @@ -94,6 +99,10 @@ module Mauve @thread.raise(ex) end + def backtrace + @thread.backtrace if @thread.is_a?(Thread) + end + def restart self.stop self.start |