This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/Thread.schelp is in supercollider-common 1:3.6.3~repack-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class::Thread
summary::represents an individual operating system thread
categories::Core>Kernel
related:: Classes/Routine

description::

Normally there is no need to instantiate a Thread, but its subclass Routine is very useful.

It is wise not to fiddle with the source code for this class; see the warnings in the class file.

method:: thisThread
The global pseudo-variable code::thisThread:: always returns the enclosing thread running the given code. A Thread is aware of its own attached clock and associated beats and seconds timing, and has an individual random number seed and exception handler.

code::
// example
thisThread.beats;
thisThread.seconds;
thisThread.clock;
::

classMethods::

method::new

Create a Thread.

note:: You will not typically do this yourself but as a result of creating Routines, for example.::

code::
g = Thread({"hello".postln;});
g.seconds; //time of creation, cannot advance without a clock
::

argument::func
A function with code for the thread to run.

argument::stackSize
defaults to 64 depth call stack.

instanceMethods::

method::beats
Get or set the elapsed beats (logical time) of the thread.

method::seconds
Get or set the elapsed seconds (logical time) of the thread.

method::clock
Get or set the thread's clock.

method::isPlaying
Returns:: true if it is playing.

method::state

The internal state values for a Thread instance can be polled:
table::
## 0 || not started
## 7 || running
## 8 || stopped
::

subsection::Seeding the random number generator

see also: link::Reference/randomSeed::

method::randSeed
Set the random number generator seed using a single integer.
discussion::
Example:
code::
g = thisThread.randSeed = 4;
10.do{1.0.rand2.postln};
::

method::randData

Get or set the three integer array which defines the internal basis for the random number generator.  You can use this to get back the exact same random number sequence, and it provides a mechanism for automatic replay for generative music.
discussion::
Example:
code::
g = thisThread.randData;
10.do{1.0.rand2.postln};
::
code::
// each time the seed is reset, the random number generation should give the same sequence
thisThread.randData_(Int32Array[ -662787342, 1546785953, 1661466823 ]);
10.do{1.0.rand2.postln};
::