#include <WScom.h>
#include <WSCfunctionList.h>
#include <WSCbase.h>
#include <unistd.h>
//----------------------------------------------------------
//Function for the event procedure
//----------------------------------------------------------
#include <newwin000.h>
extern long cnt;
extern WSCbool dialog_vis_status;
void thread_proc(WSCbase* object){
  //do something...
  cnt=0;
  while(1){
    cnt++;
    newvthr_002->sendActivateEvent();

    if (dialog_vis_status == False){
      // thread canceled..
      return;
    }
    if (cnt > 100){
      // thread done..
      return;
    }

    //do a long work.. 
#ifdef MSW
    Sleep(1000);
#else
    sleep(1);
#endif
  }
}
static WSCfunctionRegister  op("thread_proc",(void*)thread_proc);
