Locks in Base_mappable class

Adam Lackorzynski adam at os.inf.tu-dresden.de
Sun Aug 24 23:38:50 CEST 2014


On Fri Aug 22, 2014 at 16:45:51 -0400, Yuxin Ren wrote:
> In the Base_mappable class, in /fiasco/src/kern/mapping_tree.cpp file,
> what is type of the lock in this class, helping lock, spin lock or others?

Looks like it's a Helping_lock.
 
> And usually I find it is hard to identify the type of a lock.
> Could someone tell me how to figure out the lock's type?

What I did just now:
 - Look up src/kern/mapping_tree.cpp, find class Base_mappable, find
   this line in the class:
   typedef ::Lock Lock;
 - Seeing that Lock is of type ::Lock
 - Searching for 'lock' within the file
 - Finding out that #include "lock.h" is the most obvious way to go on
   searching
 - Opening src/kern/lock.cpp
 - Seeing: typedef Helping_lock Lock;
 - Done

So the point with going further to lock.cpp may not be so obvious but
generally it's just reading around in the code.



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list