[m-rev.] for review: Add thread.spawn_native/5 with minimum stack size option.

Peter Wang novalazy at gmail.com
Wed Oct 27 15:01:19 AEDT 2021


On Wed, 27 Oct 2021 11:35:58 +1100 Julien Fischer <jfischer at opturion.com> wrote:
> 
> > +    % Create a new thread options object.
> > +    %
> > +:- func init_thread_options = thread_options.
> 
> I think you need to add:
> 
>       ... with the options set to their default values.
> 
> and then describe what those defaults are.  The latter can be done
> either here or in the comment above the predicate that sets the
> respective option.

Ok, I've committed it with these changes:

diff --git a/library/thread.m b/library/thread.m
index 7f70e5d4b..ca450ad8c 100644
--- a/library/thread.m
+++ b/library/thread.m
@@ -71,16 +71,19 @@
     %
 :- type thread_options.
 
-    % Create a new thread options object.
+    % Create a new thread options object with options set to their default
+    % values. The options are:
+    %
+    % - min_stack_size: the minimum stack size in bytes (default: 0).
+    %   The special value 0 means to use the default stack size as chosen by
+    %   the underlying environment.
     %
 :- func init_thread_options = thread_options.
 
     % Set the minimum stack size (in bytes) for a new thread created with these
-    % thread options. Only affects POSIX threads backend. The Java and C#
-    % backends do not yet respect the minimum stack size option.
-    %
-    % The special value 0 means to use the default stack size of the underlying
-    % environment.
+    % thread options. This only affects C grades that use POSIX threads.
+    % The Java and C# backends do not yet respect the minimum stack size
+    % option.
     %
 :- pred set_min_stack_size(uint::in, thread_options::in, thread_options::out)
     is det.

Peter


More information about the reviews mailing list