,2נ55.5.0+dev0-2025-04-28/&Thread!tA;@@@A@@@@@ %../../otherlibs/systhreads/thread.mliRR@@@@&Thread@@A@&create@@!a@B@!b@B@@@@&Thread!t@@@@@@@@%W&W@@$A@@$self@$unit@@@&Thread!t@@@@@@>h?h,@@=B@@"id@&Thread!t@@@#int@@@@@@WkkkXkk|@@VC@@7set_current_thread_name@&string@@@8@@@@@@mp 9 9np 9 e@@lD@@±$ExitB##exnG@@@Az{  {{  @@yE@B@$exit@U@@@Z @@@@@@D P PE h @0ocaml.deprecatedE h kE h {@ Use 'raise Thread.Exit' instead.E h }E h @@E h |E h @@@@@@E h h@@F@@%delay@%float @@@ @@@@@@WW@@G@@$join@&Thread !t@@@ @@@@@@\ee\ey@@H@@%yield@@@@@@@@@@``@@I@@/wait_timed_read@$Unix*file_descr@@@ @M@@@ $bool@@@ @@ @@ @ m n3b@0ocaml.deprecatedn36n3F@8Use Unix.select instead.n3Hn3`@@!n3G"n3a@@@@@@%n33@@#J@@0wait_timed_write@$Unix*file_descr@@@@@@@9@@@@@@@@CqDr@0ocaml.deprecatedJrKr@8Use Unix.select instead.VrWr@@YrZr@@@@@@]r@@[K@@&select@$list$Unix*file_descr@@@@@@@$Unix*file_descr@@@@@@ @!$Unix*file_descr@@@ @@@ @@@@@:$Unix*file_descr@@@@@@@J $Unix*file_descr@@@@@@@Z"$Unix!*file_descr@@@@@@@@@@@@@@@@@}@0ocaml.deprecated@8Use Unix.select instead.@@@@@@@@@@L@@(wait_pid@#@@@@$@@@@$Unix%.process_status@@@@@ @@!@  @0ocaml.deprecated@9Use Unix.waitpid instead.@@!"@@@@@@%@@#M@@'sigmask@$Unix&3sigprocmask_command@@@"@('@@@#@@@%*)@@@&@@@(@@)@@*@O%%P%c@@NN@@+wait_signal@,+@@@+@@@--@@@.@@/@jIIkIj@@iO@@ "default_uncaught_exception_handler@.@@@0J/@@@1@@2@O@@~P@@>set_uncaught_exception_handler@@0@@@3a1@@@4@@5f2@@@6@@7@ @@Q@@@3>Lightweight threads for Posix '1003.1c+ and Win32.@@@@@@@@@@@@A %../../otherlibs/systhreads/thread.mli#(Thread.t3;The type of thread handles.@@@@@@@@@@@@@@A@@@@A@?Thread creation and termination@@-Thread.create37Thread.create funct arg G creates a new thread of control, in which the function application )funct arg Y is executed concurrently with the other threads of the domain. The application of -Thread.create f returns the handle of the newly created thread. The new thread terminates when the application )funct arg / returns, either normally or by raising the +Thread.ExitG@ exception or by raising any other uncaught exception. In the last case, the uncaught exception is printed on standard error, but not propagated back to the parent thread. Similarly, the result of the application )funct arg B is discarded and not directly accessible to the parent thread.@- See also ,Domain.spawn@@ ( if you want parallel execution instead.@@@@@@@@@@@@@ @@@@@۠+Thread.self3 5Return the handle for the thread currently executing.@@@@@@@@@@@@@@@@@Ѡ)Thread.id3 Return the identifier of the given thread. A thread identifier is an integer that identifies uniquely the thread. It can be used to build data structures indexed by threads.@@@@@@@@@@@@@"@@@@Ǡ>Thread.set_current_thread_name3 Set the thread's name. This should be called from within the thread function. Setting thread name is available on most systems.@ } This does nothing if the functionality is not implemented but will print a warning on the standard error if enabled.@ ; Likewise, a warning is printed if the operation fails.@@@@#5.4@@@@@@@@;@@@@ʠX3 lException raised by user code to initiate termination of the current thread. In a thread created by ~D@! %funct! #arg-, if the rG@ 2 exception reaches the top of the application )funct arg , it has the effect of terminating the current thread silently. In other contexts, there is no implicit handling of the ~G@+ exception.@@@@@@@@@@@@@@@@@@+Thread.exit3*Raise the G@ ' exception. In a thread created by D@ y, this will cause the thread to terminate prematurely, unless the thread function handles the exception itself. +Fun.protect@@ B finalizers and catch-all exception handlers will be executed.@ To make it clear that an exception is raised and will trigger finalizers and catch-all exception handlers, it is recommended to write 1raise Thread.Exit, instead of .Thread.exit ()!.@@@@@#5.0 A different implementation was used, not based on raising an exception, and not running finalizers and catch-all handlers. The previous implementation had a different behavior when called outside of a thread created by -Thread.create@@!.@@@@@@@@ @!@@@@A@2Suspending threads@@,Thread.delay3'delay d 5 suspends the execution of the calling thread for !d H seconds. The other program threads continue to run during this time.@@@@@@@@@@@@@@@@@ +Thread.join3'join th B suspends the execution of the calling thread until the thread "th0 has terminated.@@@@@@@@@@@@@@@@@ ,Thread.yield3 Re-schedule the calling thread without suspending it. This function can be used to give scheduling hints, telling the scheduler that now is a good time to switch to other threads.@@@@@@@@@@@@ @ @@@@A@ )Waiting for file descriptors or processes@@ WThe functions below are leftovers from an earlier, VM-based threading system. The $Unix@@ module provides equivalent functionality, in a more general and more standard-conformant manner. It is recommended to use $Unix@@4 functions directly.@6Thread.wait_timed_read3$See 7Thread.wait_timed_writeD@!.@@@@@@@@@@@@&@#'@& @@@@3 mSuspend the execution of the calling thread until at least one character or EOF is available for reading (/wait_timed_read 7) or one character can be written without blocking (0wait_timed_write ) on the given Unix file descriptor. Wait for at most the amount of time given as second argument (in seconds). Return $true 9 if the file descriptor is ready for input/output and %false H if the timeout expired. The same functionality can be achieved with +Unix.select@@!.@@@@@@@@@@@@@U @X@@@@-Thread.select31Same function as +Unix.select@@ . Suspend the execution of the calling thread until input/output becomes possible on the given Unix file descriptors. The arguments and results have the same meaning as for +Unix.select@@!.@@@@@@@@@@@@@v @y@|@@@@@/Thread.wait_pid31Same function as ,Unix.waitpid@@%. *wait_pid p g suspends the execution of the calling thread until the process specified by the process identifier !p Z terminates. Returns the pid of the child caught and its termination status, as per )Unix.wait@@!.@@@@@@@@@@@@@@@@@A@5Management of signals@@ Signal handling follows the POSIX thread model: signals generated by a thread are delivered to that thread; signals generated externally are delivered to one of the threads that does not block it. Each thread possesses a set of blocked signals, which can be modified using .Thread.sigmaskD@ . This set is inherited at thread creation time. Per-thread signal masks are supported only by the system thread library under Unix, but not under Win32, nor by the VM thread library.@31Same function as 0Unix.sigprocmask@@%. 0sigmask cmd sigs E changes the set of blocked signals for the calling thread. If #cmd$ is +SIG_SETMASK 2, blocked signals are set to those in the list $sigs(. If #cmd$ is )SIG_BLOCK1, the signals in $sigs 3 are added to the set of blocked signals. If #cmd$ is +SIG_UNBLOCK1, the signals in $sigs 4 are removed from the set of blocked signals. 'sigmask > returns the set of previously blocked signals for the thread.@@@@@@@@@@@@@@@@@@ 2Thread.wait_signal31Same function as ,Unix.sigwait@@%. 0wait_signal sigs x suspends the execution of the calling thread until the process receives one of the signals specified in the list $sigs d. It then returns the number of the signal received. Signal handlers attached to the signals in $sigs & will not be invoked. The signals $sigs . are expected to be blocked before calling +wait_signal!.@@@@@@@@@@@@@H@@@@ڠA@3Uncaught exceptions@@ )Thread.default_uncaught_exception_handler3 )Thread.default_uncaught_exception_handler H will print the thread's id, exception and backtrace (if available).@@@@@@@@@@@@@a@@@@ޠ %Thread.set_uncaught_exception_handler3 (Thread.set_uncaught_exception_handler fn+ registers "fn , as the handler for uncaught exceptions.@ I If the newly set uncaught exception handler raise an exception, (D@0 will be called.@@@@@@@@@@@@@@@@@@@@@A$Unix@@@@@