Cocos was using pthread for its locking here, so I did not introduce any new dependencies or APIs.