build fixes
fix macros
integrated srwlock kernel from APC
fix param count
Merge pull request #1 from weltling/simplify

Integrated locks from APC + some fixes