fix potential memory link
add barrier-request handling
remove unused variables to avoid compiler warnings