diff options
author | Dhananjay Balan <mb.dhananjay@gmail.com> | 2013-07-29 10:25:38 +0530 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-08-25 09:52:40 +1000 |
commit | 8e0de06b2bc6fecf8e055361590176698d0a648b (patch) | |
tree | 48da111ac76bc7a8e985e4401fb6e257fde8abda /tools/gdb/python/supercore.py | |
parent | c63080ddb2231ca0577514e393f4e793f1819d19 (diff) |
Add classic barrier.
- Add support for classic barrier object.
- Drop CORE_ from names in supercore
Diffstat (limited to 'tools/gdb/python/supercore.py')
-rw-r--r-- | tools/gdb/python/supercore.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tools/gdb/python/supercore.py b/tools/gdb/python/supercore.py index 073bbd0..e60813a 100644 --- a/tools/gdb/python/supercore.py +++ b/tools/gdb/python/supercore.py @@ -5,7 +5,7 @@ import threads import helper -class CORE_message_queue: +class message_queue: '''Manage a Supercore message_queue''' def __init__(self, message_queue): @@ -16,3 +16,38 @@ class CORE_message_queue: def show(self): helper.tasks_printer_routine(self.wait_queue) + +class barrier_attributes: + '''supercore bbarrier attribute''' + + def __init__(self,attr): + self.attr = attr + + def max_count(self): + c = self.attr['maximum_count'] + return c + + def discipline(self): + d = self.attr['discipline'] + return d + +class barrier_control: + '''Manage a Supercore barrier''' + + def __init__(self, barrier): + self.barrier = barrier + self.wait_queue = threads.queue(self.barrier['Wait_queue']) + self.attr = barrier_attributes(self.barrier['Attributes']) + + def waiting_threads(self): + wt = self.barrier['number_of_waiting_threads'] + return wt + + def max_count(self): + return self.attr.max_count() + + def discipline(self): + return self.attr.discipline() + + def tasks(self): + return self.wait_queue |