This repository was archived by the owner on Aug 1, 2022. It is now read-only.
File tree 1 file changed +26
-15
lines changed
1 file changed +26
-15
lines changed Original file line number Diff line number Diff line change @@ -126,22 +126,8 @@ worker_idle_threshold_per_cpu(void)
126
126
return 2 ;
127
127
}
128
128
129
- #if !defined(__ANDROID__ )
130
- static void
131
- manager_reinit (void )
132
- {
133
- if (manager_init () < 0 )
134
- abort ();
135
-
136
- for (size_t i = 0 ; i < PTHREAD_WORKQUEUE_MAX ; i ++ ) {
137
- wqlist [i ] = NULL ;
138
- ocwq [i ] = NULL ;
139
- }
140
- }
141
- #endif
142
-
143
129
int
144
- manager_init (void )
130
+ _manager_init_common (void )
145
131
{
146
132
wqlist_has_manager = 0 ;
147
133
pthread_cond_init (& wqlist_has_work , NULL );
@@ -183,6 +169,31 @@ manager_init(void)
183
169
worker_min = cpu_count > 1 ? cpu_count : 2 ;
184
170
worker_idle_threshold = (PWQ_ACTIVE_CPU > 0 ) ? (PWQ_ACTIVE_CPU ) : worker_idle_threshold_per_cpu ();
185
171
172
+ return (0 );
173
+ }
174
+
175
+ #if !defined(__ANDROID__ )
176
+ static void
177
+ manager_reinit (void )
178
+ {
179
+ if (_manager_init_common () < 0 )
180
+ abort ();
181
+
182
+ for (size_t i = 0 ; i < PTHREAD_WORKQUEUE_MAX ; i ++ ) {
183
+ wqlist [i ] = NULL ;
184
+ ocwq [i ] = NULL ;
185
+ }
186
+ }
187
+ #endif
188
+
189
+ int
190
+ manager_init (void )
191
+ {
192
+ int status = _manager_init_common ();
193
+ if (status != 0 ) {
194
+ return status ;
195
+ }
196
+
186
197
/* FIXME: should test for symbol instead of for Android */
187
198
#if !defined(__ANDROID__ )
188
199
if (pthread_atfork (NULL , NULL , manager_reinit ) < 0 ) {
You can’t perform that action at this time.
0 commit comments