08: fixed pointer cast warnings
08: fixed line length
08: added locking via rwsem