// Author: drivermonkey // Phone: 13410905075 // mail: bookworepeng@Hotmail.com // QQ: 196568501 # include <pthread. h> # include <unistd. h ># include <iostream> using namespace STD; static void * thead_gui (void * Arg); static void * thread_logic (void * Arg); int main () {pthread_t thread_gui_id = 0; pthread_t thread_logic_id = 0; pthread_create (& thread_gui_id, null, & thead_gui, null); pthread_create (& thread_logic_id, null, & thread_logic, null ); pthread_join (thread_gui_id, null); pthread_join (thread_gui_id, null); Return 0;} static void * thead_gui (void * Arg) {int sleep_count = 0; sleep_count = 3; while (sleep_count --) {cout <"thead_gui: sleep_count =" <sleep_count <Endl; sleep (sleep_count) ;}} static void * thread_logic (void * Arg) {int sleep_count = 0; sleep_count = 3; while (sleep_count --) {cout <"thread_logic: sleep_count =" <sleep_count <Endl; sleep (sleep_count );}}