uo_thread.sru 914 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. $PBExportHeader$uo_thread.sru
  2. $PBExportComments$线程对象
  3. forward
  4. global type uo_thread from nonvisualobject
  5. end type
  6. end forward
  7. global type uo_thread from nonvisualobject
  8. end type
  9. global uo_thread uo_thread
  10. type prototypes
  11. Subroutine Sleep (ulong dwMilliseconds) Library "KERNEL32.DLL"
  12. end prototypes
  13. type variables
  14. nonvisualobject inv_pbcomm
  15. int ins_stopflag=0 //1-stop
  16. end variables
  17. forward prototypes
  18. public subroutine of_start ()
  19. public subroutine of_setparent (nonvisualobject arg_pbcomm)
  20. end prototypes
  21. public subroutine of_start ();do while ins_stopflag=0
  22. inv_pbcomm.triggerevent("ue_thread")
  23. sleep(100)
  24. loop
  25. end subroutine
  26. public subroutine of_setparent (nonvisualobject arg_pbcomm);inv_pbcomm = arg_pbcomm
  27. end subroutine
  28. on uo_thread.create
  29. call super::create
  30. TriggerEvent( this, "constructor" )
  31. end on
  32. on uo_thread.destroy
  33. TriggerEvent( this, "destructor" )
  34. call super::destroy
  35. end on