Skip to content

Instantly share code, notes, and snippets.

@picanumber
Last active August 17, 2021 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save picanumber/686bc8533a3922cd1389db0ba84e22c1 to your computer and use it in GitHub Desktop.
Save picanumber/686bc8533a3922cd1389db0ba84e22c1 to your computer and use it in GitHub Desktop.
std::shared_ptr<Locking<X>> yy(std::make_shared<Locking<X>>(X{}));
(*yy.get())->f(msg);
// This is most likely unsafe, since we can only lock a single copy of the pointer
Locking<std::shared_ptr<X>> xx(std::make_shared<X>());
xx->get()->f(msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment