fix thread mask inheritance