Skip to content

Instantly share code, notes, and snippets.

@miloyip
Last active February 16, 2016 09:54
Show Gist options
  • Save miloyip/3cfc08eabb6f2c2ed7f8 to your computer and use it in GitHub Desktop.
Save miloyip/3cfc08eabb6f2c2ed7f8 to your computer and use it in GitHub Desktop.
#include "rapidjson/document.h"
#include <iostream>
#include <pthread.h>
void* MyThread(void*)
{
std::cout << "Start of MyThread" << std::endl;
rapidjson::Document doc;
doc.Parse("{ \"NAME\": \"Peter\", \"AGE\": 38, \"Male\": true}");
std::cout << "End!";
return NULL;
}
int main(int argc, char** argv)
{
pthread_t thread;
pthread_create(&thread, NULL, &MyThread, NULL);
std::string str;
std::cout << "Press return..." << std::endl;
std::getline(std::cin, str);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment