… | |
… | |
202 | static void |
202 | static void |
203 | pmapi_release (void) |
203 | pmapi_release (void) |
204 | { |
204 | { |
205 | #if RECURSION_CHECK |
205 | #if RECURSION_CHECK |
206 | if (X_TLS_GET (check_key)) |
206 | if (X_TLS_GET (check_key)) |
207 | fatal ("perlinterp_release () called without valid perl context"); |
207 | fatal ("FATAL: perlinterp_release () called without valid perl context"); |
208 | |
208 | |
209 | X_TLS_SET (check_key, &check_key); |
209 | X_TLS_SET (check_key, &check_key); |
210 | #endif |
210 | #endif |
211 | |
211 | |
212 | if (! ((thread_enable ? thread_enable : global_enable) & 1)) |
212 | if (! ((thread_enable ? thread_enable : global_enable) & 1)) |
… | |
… | |
245 | int jeret; |
245 | int jeret; |
246 | struct tctx *ctx = X_TLS_GET (current_key); |
246 | struct tctx *ctx = X_TLS_GET (current_key); |
247 | |
247 | |
248 | #if RECURSION_CHECK |
248 | #if RECURSION_CHECK |
249 | if (X_TLS_GET (check_key) != &check_key) |
249 | if (X_TLS_GET (check_key) != &check_key) |
250 | fatal ("perlinterp_acquire () called with valid perl context"); |
250 | fatal ("FATAL: perlinterp_acquire () called with valid perl context"); |
251 | |
251 | |
252 | X_TLS_SET (check_key, 0); |
252 | X_TLS_SET (check_key, 0); |
253 | #endif |
253 | #endif |
254 | |
254 | |
255 | if (!ctx) |
255 | if (!ctx) |
… | |
… | |
301 | |
301 | |
302 | perl_thx = PERL_GET_CONTEXT; |
302 | perl_thx = PERL_GET_CONTEXT; |
303 | |
303 | |
304 | I_CORO_API ("Coro::Multicore"); |
304 | I_CORO_API ("Coro::Multicore"); |
305 | |
305 | |
|
|
306 | if (0) { /*D*/ |
306 | X_LOCK (release_m); |
307 | X_LOCK (release_m); |
307 | while (idle < min_idle) |
308 | while (idle < min_idle) |
308 | start_thread (); |
309 | start_thread (); |
309 | X_UNLOCK (release_m); |
310 | X_UNLOCK (release_m); |
|
|
311 | } |
310 | |
312 | |
311 | /* not perfectly efficient to do it this way, but it is simple */ |
313 | /* not perfectly efficient to do it this way, but it is simple */ |
312 | perl_multicore_init (); /* calls release */ |
314 | perl_multicore_init (); /* calls release */ |
313 | perl_multicore_api->pmapi_release = pmapi_release; |
315 | perl_multicore_api->pmapi_release = pmapi_release; |
314 | perl_multicore_api->pmapi_acquire = pmapi_acquire; |
316 | perl_multicore_api->pmapi_acquire = pmapi_acquire; |