Skip to content

Instantly share code, notes, and snippets.

@nglee
Created July 14, 2018 05:09
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 nglee/164bde324c6c03a50047648c222d0b28 to your computer and use it in GitHub Desktop.
Save nglee/164bde324c6c03a50047648c222d0b28 to your computer and use it in GitHub Desktop.
Persistence of file_lock
#include <boost/interprocess/sync/file_lock.hpp>
#include <iostream>
using namespace boost::interprocess;
int main()
{
file_lock flock("bitest5.cpp");
flock.lock();
std::cout << "The process locked an file_lock," << std::endl;
std::cout << "and is going to exit without unlocking the lock." << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment