How to change the ACCESS_MASK of a thread?