main.C (679B)
1 //Copyright (c) 2002-2003 Nasca Octavian Paul 2 //License: GNU GPL 2 3 4 #include <pthread.h> 5 #include "Spliter.h" 6 #include "SpliterUI.h" 7 8 pthread_t thr1, thr2; 9 Spliter spliter; 10 11 void *thread1(void *arg) { 12 Fl::run(); 13 return 0; 14 } 15 void *thread2(void *arg) { 16 while(Pexitprogram == 0) 17 spliter.midievents(); 18 return 0; 19 } 20 21 22 main() 23 { 24 Pexitprogram = 0; 25 SpliterUI *spliterUI = new SpliterUI(&spliter); 26 27 pthread_mutex_init(&mutex, NULL); 28 pthread_create(&thr1, NULL, thread1, NULL); 29 pthread_create(&thr2, NULL, thread2, NULL); 30 31 while(Pexitprogram == 0) { 32 usleep(100000); 33 } 34 35 pthread_mutex_destroy(&mutex); 36 delete spliterUI; 37 };