Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_thread.Barrier Class Reference

List of all members.

Public Member Functions

def __init__
def enter

Public Attributes

 num_threads
 waiting
 checkin_mutex
 checkout_mutex

Detailed Description

Definition at line 132 of file test_thread.py.


Constructor & Destructor Documentation

def test.test_thread.Barrier.__init__ (   self,
  num_threads 
)

Definition at line 133 of file test_thread.py.

00133 
00134     def __init__(self, num_threads):
00135         self.num_threads = num_threads
00136         self.waiting = 0
00137         self.checkin_mutex  = thread.allocate_lock()
00138         self.checkout_mutex = thread.allocate_lock()
00139         self.checkout_mutex.acquire()

Here is the caller graph for this function:


Member Function Documentation

Definition at line 140 of file test_thread.py.

00140 
00141     def enter(self):
00142         self.checkin_mutex.acquire()
00143         self.waiting = self.waiting + 1
00144         if self.waiting == self.num_threads:
00145             self.waiting = self.num_threads - 1
00146             self.checkout_mutex.release()
00147             return
00148         self.checkin_mutex.release()
00149 
00150         self.checkout_mutex.acquire()
00151         self.waiting = self.waiting - 1
00152         if self.waiting == 0:
00153             self.checkin_mutex.release()
00154             return
00155         self.checkout_mutex.release()
00156 

Here is the caller graph for this function:


Member Data Documentation

Definition at line 136 of file test_thread.py.

Definition at line 137 of file test_thread.py.

Definition at line 134 of file test_thread.py.

Definition at line 135 of file test_thread.py.


The documentation for this class was generated from the following file: