proxygen
deadlock.MutexType Class Reference
Inheritance diagram for deadlock.MutexType:

Static Public Member Functions

def get_mutex_type (thread_id, top_line)
 
def get_mutex_owner_and_address_func_for_type (mutex_type)
 

Static Public Attributes

string PTHREAD_MUTEX_T = 'pthread_mutex_t'
 
string PTHREAD_RWLOCK_T = 'pthread_rwlock_t'
 

Detailed Description

Types of mutexes that we can detect deadlocks.

Definition at line 257 of file deadlock.py.

Member Function Documentation

def deadlock.MutexType.get_mutex_owner_and_address_func_for_type (   mutex_type)
static
Returns a function to resolve the mutex owner and address for
the given type. The returned function f has the following
signature:

    f: args: (map of thread lwp -> thread id), blocked thread lwp
       returns: (lwp of thread owning mutex, mutex address)
        or (None, None) if not found.

Returns None if there is no function for this mutex_type.

Definition at line 281 of file deadlock.py.

282  '''
283  Returns a function to resolve the mutex owner and address for
284  the given type. The returned function f has the following
285  signature:
286 
287  f: args: (map of thread lwp -> thread id), blocked thread lwp
288  returns: (lwp of thread owning mutex, mutex address)
289  or (None, None) if not found.
290 
291  Returns None if there is no function for this mutex_type.
292  '''
293  if mutex_type == MutexType.PTHREAD_MUTEX_T:
294  return get_pthread_mutex_t_owner_and_address
295  if mutex_type == MutexType.PTHREAD_RWLOCK_T:
296  return get_pthread_rwlock_t_owner_and_address
297  return None
298 
299 
def get_mutex_owner_and_address_func_for_type(mutex_type)
Definition: deadlock.py:281
def deadlock.MutexType.get_mutex_type (   thread_id,
  top_line 
)
static
Returns the probable mutex type, based on the first line
of the thread's stack. Returns None if not found.

Definition at line 264 of file deadlock.py.

References deadlock.is_thread_blocked_with_frame().

264  def get_mutex_type(thread_id, top_line):
265  '''
266  Returns the probable mutex type, based on the first line
267  of the thread's stack. Returns None if not found.
268  '''
269 
271  thread_id, top_line, '__lll_lock_wait', 'pthread_mutex'
272  ):
273  return MutexType.PTHREAD_MUTEX_T
275  thread_id, top_line, 'futex_wait', 'pthread_rwlock'
276  ):
277  return MutexType.PTHREAD_RWLOCK_T
278  return None
279 
def get_mutex_type(thread_id, top_line)
Definition: deadlock.py:264
def is_thread_blocked_with_frame(thread_id, top_line, expected_top_line, expected_frame)
Definition: deadlock.py:246

Member Data Documentation

string deadlock.MutexType.PTHREAD_MUTEX_T = 'pthread_mutex_t'
static

Definition at line 260 of file deadlock.py.

string deadlock.MutexType.PTHREAD_RWLOCK_T = 'pthread_rwlock_t'
static

Definition at line 261 of file deadlock.py.


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