Thread termination monitoring / was: Passing procedure as a parameter prior to 11.1

Use the .DESTRUCT of a CLASS,THREAD

Clarion ThreadMonitor class - used to Notify a thread as each thread starts and ends (github.com)

   INCLUDE('ThreadMonitor.inc'),ONCE    !<-- threaded instance
ThreadMonitor ctThreadMonitor,THREAD 

   ThreadMonitor.ConstructEvent( 0 ) !<-- disable
   ThreadMonitor.DestructEvent (Event:ThreadEnded)
   ThreadMonitor.ThreadToInform( AppFrame{prop:Thread} )

   ! where Event:ThreadEnded is an Event:App+N
1 Like