• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

10.1 Creating and destroying Prolog threads
All Application Manual Name SummaryHelp

  • 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
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 is based on the reserved unwind(thread_exit(Term)) exception. This implies that, unlike the previous implementation that was based on the C pthread_exit() function, the implementation is safe from the Prolog point of view. However, it is limited by the semantics of the unwind exceptions. See section 4.10.1 for details.

This predicate raises a permission_error if it is known that the thread cannot handle this case.

ClioPatria (version V3.1.1-51-ga0b30a5)