1 // This testcase was in the python subdirectory
3 #if defined(SWIGPYTHON)
4 // Is "threads" really needed for Python? It seems to work without it.
5 %module(directors="1",threads="1") director_thread
7 %module(directors="1") director_thread
25 unsigned int __stdcall working(void* t);
26 unsigned int thread_id(0);
28 void* working(void* t);
31 static int thread_terminate = 0;
39 static void MilliSecondSleep(int milliseconds) {
43 usleep(milliseconds*1000);
60 /*TODO(bhy) what to do for win32? */
62 pthread_join(thread, NULL);
68 _beginthreadex(NULL,0,working,this,0,&thread_id);
70 pthread_create(&thread,NULL,working,this);
72 MilliSecondSleep(500);
75 virtual void do_foo() {
84 unsigned int __stdcall working(void* t)
86 void* working(void* t)
89 Foo* f = static_cast<Foo*>(t);
90 while ( ! thread_terminate ) {
95 /* TODO(bhy) what's the corresponding of pthread_exit in win32? */