combine testandset and set command