The author today uses C + + 11 Std::thread on the Android device to create a thread control network asynchronous send, found that the thread started to flash off, it is estimated that the Android device does not support the C++11 line libraries, or the Android system version is too low, so or back to the previous Pthread_ Creating to create threads, here are three ways to create threads and how to use them:
Std::thread Method: (Support Windowsphone,windowsrt,ios,mac platform)
Std::thread M_thread = Std::thread (&upgrade::requesthttp,this);
M_thread.detach ();
Pthread_create Method: (Support UNIX, Linux, Mac OS X, IOS, Android)
pthread_t _thread;
Pthread_create (&_thread, NULL, &upgrade::requesthttp, this);
Pthread_detach (_thread);
CreateThread Method: (Support for Windows PC platform)
CreateThread (NULL,//default security attributes
0,//use default stack size
&upgrade::requesthttp,//thread function name
This,//argument to thread function
0,//Use default creation Flags
NULL);
Reprint please indicate the source, from the blog Park Hemjohn
Android Thread Usage issues