Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2475)

Unified Diff: commit-queue/sig_handler.py

Issue 135363007: Delete public commit queue to avoid confusion after move to internal repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « commit-queue/projects.py ('k') | commit-queue/subversion_config/config » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: commit-queue/sig_handler.py
===================================================================
--- commit-queue/sig_handler.py (revision 249146)
+++ commit-queue/sig_handler.py (working copy)
@@ -1,48 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging as _logging
-import signal as _signal
-import threading as _threading
-
-_OK_HANDLERS = set((
- _signal.SIG_DFL,
- _signal.SIG_IGN,
- _signal.default_int_handler,
-))
-
-# Only manipulated on the main thread, so it doesn't need a lock.
-_PREV_HANDLERS = {}
-
-_SET_SIGNALS_LOCK = _threading.Lock()
-_SET_SIGNALS = set()
-
-
-def _handler(signal_num, _):
- with _SET_SIGNALS_LOCK:
- _SET_SIGNALS.add(signal_num)
- _signal.signal(signal_num, _PREV_HANDLERS[signal_num])
- _logging.warn(
- '\n'
- 'commit-queue will exit at the end of this processing loop.\n'
- 'Hit Ctrl-C again to exit immediately.'
- )
-
-
-def getTriggeredSignals():
- with _SET_SIGNALS_LOCK:
- return _SET_SIGNALS.copy()
-
-
-def installHandlers(*signal_numbers):
- for signal_num in signal_numbers:
- cur_handler = _signal.getsignal(signal_num)
- if cur_handler == _handler:
- continue
-
- assert cur_handler in _OK_HANDLERS, \
- 'A signal handler is already installed for signal %d' % signal_num
-
- _PREV_HANDLERS[signal_num] = cur_handler
- _signal.signal(signal_num, _handler)
« no previous file with comments | « commit-queue/projects.py ('k') | commit-queue/subversion_config/config » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698