Here are some examples showing the problem. Example1: ------------- ~~~~~~~~~~~~~~~~~~~~ class FOO create make feature make local l_thread: MY_THREAD do print ("Thread start%N") create l_thread.make l_thread.launch l_thread.join print ("Thread done%N") end end ~~~~~~~~~~~~~~~~~~~~ class MY_THREAD inherit THREAD rename terminated as thread_terminated end create make feature execute do print ("Execute thread (start)%N") (create {EXECUTION_ENVIRONMENT}).sleep (5000000000) print ("Execute thread (done)%N") end end ~~~~~~~~~~~~~~~~~~~~ Output: ~~~~~~~~~~~~~~~~~~~~ Thread start Execute thread (start) Execute thread (done) ~~~~~~~~~~~~~~~~~~~~ The program never terminates. Example2: ------------- ~~~~~~~~~~~~~~~~~~~~ class FOO create make feature make local l_thread: MY_THREAD do print ("Thread start%N") create l_thread.make l_thread.launch l_thread.join print ("Thread done%N") print ("%N") end end ~~~~~~~~~~~~~~~~~~~~ class MY_THREAD inherit THREAD rename terminated as thread_terminated end create make feature terminated: INTEGER execute do print ("Execute thread (start)%N") terminated := 0xFFFFFFFF (create {EXECUTION_ENVIRONMENT}).sleep (5000000000) print ("Execute thread (done)%N") end end ~~~~~~~~~~~~~~~~~~~~ Output: ~~~~~~~~~~~~~~~~~~~~ Thread start Execute thread (start) Thread done ~~~~~~~~~~~~~~~~~~~~ The main thread stopped waiting, even though the thread was not finished. Example3: ------------ ~~~~~~~~~~~~~~~~~~~~ class FOO create make feature make local l_thread: MY_THREAD do print ("Thread start%N") create l_thread.make l_thread.launch l_thread.join print ("Thread done%N") print (l_thread.terminated) print ("%N") end end ~~~~~~~~~~~~~~~~~~~~ class MY_THREAD inherit THREAD rename terminated as thread_terminated end create make feature terminated: INTEGER execute do print ("Execute thread (start)%N") (create {EXECUTION_ENVIRONMENT}).sleep (5000000000) print ("Execute thread (done)%N") end end ~~~~~~~~~~~~~~~~~~~~ Output: ~~~~~~~~~~~~~~~~~~~~ Thread start Execute thread (start) Execute thread (done) Thread done 1 ~~~~~~~~~~~~~~~~~~~~ Here the integer attribute `terminated' has been overwritten. I don't want to imagine what would happen to the memory management if my attribute was a reference. Tomorrow I will try to provide a bug fix using a setter (to be passed to {THREAD}.create_thread_with_attr, kept in the thread context on the C side, and then called in `eif_thr_exit') and a getter (to be passed to {THREAD}.thread_wait and {THREAD}.thread_wait_with_timeout). -- Eric Bezault