diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-09-10 13:27:44 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-09-10 13:27:44 -0300 |
commit | 300ef445597ef46838ea92662dd5cce2ef03db74 (patch) | |
tree | 3f03617e40b150a8426e951e02bf4516f4446be5 | |
parent | 372b25666058ed646bc23900e50249a3549b0325 (diff) | |
download | tuna-300ef445597ef46838ea92662dd5cce2ef03db74.tar.gz |
tuna: Ignore non-existing threads in threads_set_priority
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | ChangeLog | 2 | ||||
-rwxr-xr-x | tuna/tuna.py | 10 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,5 @@ +- tuna: Ignore non-existing threads in threads_set_priority + * Thu Sep 3 2009 Arnaldo Carvalho de Melo <acme@redhat.com> - 0.9-1 - cmdline: --socket needs an argument - tuna: Present more graceful failure mode when machine can't start gui diff --git a/tuna/tuna.py b/tuna/tuna.py index 094023e..8a95ae2 100755 --- a/tuna/tuna.py +++ b/tuna/tuna.py @@ -445,11 +445,17 @@ def threads_set_priority(tids, parm, affect_children = False): rtprio = int(parms[0]) for tid in tids: - thread_set_priority(tid, policy, rtprio) + try: + thread_set_priority(tid, policy, rtprio) + except SystemError: # (3, 'No such process') + continue if affect_children: for child in [int (a) for a in os.listdir("/proc/%d/task" % tid)]: if child != tid: - thread_set_priority(child, policy, rtprio) + try: + thread_set_priority(child, policy, rtprio) + except SystemError: # (3, 'No such process') + continue class sched_tunings: def __init__(self, name, pid, policy, rtprio, affinity, percpu): |