@@ -30,33 +30,24 @@ Class {
30
30
'LibCErrnoSharedPool',
31
31
'LibCWaitSharedPool'
32
32
],
33
- #category : ' OSSubprocess'
33
+ #category : # OSSubprocess
34
34
}
35
35
36
36
{ #category : #'initialize - release' }
37
37
OSSVMProcess class >> initialize [
38
- Smalltalk os isWindows ifTrue: [ ^ self ]. "Cannot be initialized nor used on Windows."
39
-
40
- self initializeVMProcessInstance.
41
- self flag: #removeIt.
42
- "This IF will be eliminated soon...only here temporary"
43
- (SystemVersion current highestUpdate >= 50558)
44
- ifTrue: [
45
- SessionManager default registerToolClassNamed: self name
46
- ]
47
- ifFalse: [
48
- Smalltalk addToStartUpList: OSSVMProcess.
49
- Smalltalk addToShutDownList: OSSVMProcess.
50
- ]
51
-
38
+
39
+ self initializeVMProcessInstance.
40
+ SessionManager default registerToolClassNamed: self name
52
41
]
53
42
54
43
{ #category : #'initialize - release' }
55
44
OSSVMProcess class >> initializeVMProcessInstance [
56
- VMProcess isNil
57
- ifTrue: [ VMProcess := self basicNew. ]
58
- ifFalse: [ VMProcess finalizePreviousSession ].
59
- VMProcess initialize.
45
+
46
+ VMProcess ifNotNil: [
47
+ VMProcess finalizePreviousSession.
48
+ VMProcess := nil ].
49
+ Smalltalk os isWindows ifFalse: [
50
+ VMProcess := self basicNew initialize ]
60
51
]
61
52
62
53
{ #category : #'instance creation' }
@@ -73,18 +64,8 @@ OSSVMProcess class >> shutDown: quitting [
73
64
74
65
{ #category : #'system startup' }
75
66
OSSVMProcess class >> startUp: resuming [
76
-
77
- resuming ifTrue: [
78
- "To understand why the #stopWaiting, first read the comment of
79
- OSSVMProcess shutDown:
80
- It could happen that when the shutDown happened, the child process
81
- was in the wait of #waitForExitPollingEvery:doing:. Therefore, until the
82
- next cycle of the loop it won't do the queryExitStatus. So we may still
83
- have this problem in image startup. So just in case we run it too in the startup code.
84
- "
85
- self vmProcess activeChildren do: [ :each | each stopWaiting ].
86
- self initializeVMProcessInstance.
87
- ]
67
+
68
+ resuming ifTrue: [ self initializeVMProcessInstance ]
88
69
]
89
70
90
71
{ #category : #'OS Process' }
@@ -187,15 +168,19 @@ OSSVMProcess >> finalizePreviousSession [
187
168
"This method is likely called at image startup and it's job is to finalize
188
169
stuff related to the previous run and let everything clean so that
189
170
the unique instance vmProcess of OSSVMProcess can be initialized correctly at startup. "
190
- childWatcher ifNotNil: [
171
+
172
+ childWatcher ifNotNil: [
191
173
childWatcher isTerminated ifFalse: [ childWatcher terminate ].
192
- childWatcher := nil.
193
- ].
174
+ childWatcher := nil ].
194
175
sigChldSemaphore ifNotNil: [
195
176
self systemAccessor restoreSigChld.
196
- sigChldSemaphore := nil
197
- ]
198
-
177
+ sigChldSemaphore := nil ].
178
+ "To understand why the #stopWaiting, first read the comment of #shutDown:.
179
+ It could happen that when the shutDown happened, the child process was in
180
+ the wait of #waitForExitPollingEvery:doing:. Therefore, until the next cycle
181
+ of the loop it won't do the queryExitStatus. So we may still have this
182
+ problem in image startup. So just in case we run it too in the startup code."
183
+ self activeChildren do: [ :each | each stopWaiting ]
199
184
]
200
185
201
186
{ #category : #'initialize - release' }
0 commit comments