10.1 Creating and destroying Prolog threads
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Multithreaded applications
        • Creating and destroying Prolog threads
          • thread_create/2
          • thread_create/3
          • thread_self/1
          • thread_join/1
          • thread_join/2
          • thread_alias/1
          • thread_detach/1
          • thread_exit/1
          • thread_initialization/1
          • thread_at_exit/1
          • thread_setconcurrency/2
          • thread_affinity/3
    • Packages
Availability:built-in
[deprecated]thread_exit(+Term)
Terminates the thread immediately, leaving exited(Term) as result state for thread_join/2. If the thread has the attribute detached(true) it terminates, but its exit status cannot be retrieved using thread_join/2, making the value of Term irrelevant. The Prolog stacks and C thread are reclaimed.

The current implementation does not guarantee proper releasing of all mutexes and proper cleanup in setup_call_cleanup/3, etc. Please use the exception mechanism (throw/1) to abort execution using non-standard control.bugThe Windows port does not properly cleanup for detached threads while the cleanup for other threads is executed by the thread running thread_join/2 using the exited thread as engine. This is due to a bug in the MinGW pthread implementation.