Skip to content

Instantly share code, notes, and snippets.

@OlegJakushkin
Last active April 29, 2017 03:29
Show Gist options
  • Save OlegJakushkin/b1e88ae2343bfa0fabe3346429254f9f to your computer and use it in GitHub Desktop.
Save OlegJakushkin/b1e88ae2343bfa0fabe3346429254f9f to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <pico.h>
#include <zmq_addon.hpp>
#include <atomic>
#include <thread>
using namespace std;
atomic<bool> stop;
int main() {
auto server = []() {
while(!stop) {
}
};
auto client = []() {
while(!stop) {
}
};
thread s(server);
thread c(client);
while(!stop) {
string exit;
cin >> exit;
if(exit == "exit") {
stop = true;
} else {
cout << "enter 'exit' to quit" << endl;
}
}
s.join();
c.join();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment