ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Multicore/Multicore.xs
(Generate patch)

Comparing Coro-Multicore/Multicore.xs (file contents):
Revision 1.21 by root, Sun Aug 26 15:30:55 2018 UTC vs.
Revision 1.23 by root, Tue Mar 5 12:10:31 2019 UTC

27 27
28#ifndef SvREFCNT_dec_NN 28#ifndef SvREFCNT_dec_NN
29 #define SvREFCNT_dec_NN(sv) SvREFCNT_dec (sv) 29 #define SvREFCNT_dec_NN(sv) SvREFCNT_dec (sv)
30#endif 30#endif
31 31
32#ifndef SvREFCNT_dec_simple_void_NN
33 #define SvREFCNT_dec_simple_void_NN(sv) SvREFCNT_dec (sv)
34#endif
35
32#ifndef SvREFCNT_inc_NN 36#ifndef SvREFCNT_inc_NN
33 #define SvREFCNT_inc_NN(sv) SvREFCNT_inc (sv) 37 #define SvREFCNT_inc_NN(sv) SvREFCNT_inc (sv)
34#endif 38#endif
35 39
40#ifndef RECURSION_CHECK
36#define RECURSION_CHECK 0 41 #define RECURSION_CHECK 0
42#endif
37 43
38static X_TLS_DECLARE(current_key); 44static X_TLS_DECLARE(current_key);
39#if RECURSION_CHECK 45#if RECURSION_CHECK
40static X_TLS_DECLARE(check_key); 46static X_TLS_DECLARE(check_key);
41#endif 47#endif
42 48
49static void
50fatal (const char *msg)
51{
52 write (2, msg, strlen (msg));
53 abort ();
54}
43 55
44static s_epipe ep; 56static s_epipe ep;
45static void *perl_thx; 57static void *perl_thx;
46static sigset_t cursigset, fullsigset; 58static sigset_t cursigset, fullsigset;
47 59
190static void 202static void
191pmapi_release (void) 203pmapi_release (void)
192{ 204{
193 #if RECURSION_CHECK 205 #if RECURSION_CHECK
194 if (X_TLS_GET (check_key)) 206 if (X_TLS_GET (check_key))
195 croak ("perlinterp_release () called without valid perl context"); 207 fatal ("perlinterp_release () called without valid perl context");
196 208
197 X_TLS_SET (check_key, &check_key); 209 X_TLS_SET (check_key, &check_key);
198 #endif 210 #endif
199 211
200 if (! ((thread_enable ? thread_enable : global_enable) & 1)) 212 if (! ((thread_enable ? thread_enable : global_enable) & 1))
233 int jeret; 245 int jeret;
234 struct tctx *ctx = X_TLS_GET (current_key); 246 struct tctx *ctx = X_TLS_GET (current_key);
235 247
236 #if RECURSION_CHECK 248 #if RECURSION_CHECK
237 if (X_TLS_GET (check_key) != &check_key) 249 if (X_TLS_GET (check_key) != &check_key)
238 croak ("perlinterp_acquire () called with valid perl context"); 250 fatal ("perlinterp_acquire () called with valid perl context");
239 251
240 X_TLS_SET (check_key, 0); 252 X_TLS_SET (check_key, 0);
241 #endif 253 #endif
242 254
243 if (!ctx) 255 if (!ctx)
351 X_LOCK (acquire_m); 363 X_LOCK (acquire_m);
352 while (acquirers.cur) 364 while (acquirers.cur)
353 { 365 {
354 struct tctx *ctx = tctxs_get (&acquirers); 366 struct tctx *ctx = tctxs_get (&acquirers);
355 CORO_READY ((SV *)ctx->coro); 367 CORO_READY ((SV *)ctx->coro);
356 SvREFCNT_dec_NN ((SV *)ctx->coro); 368 SvREFCNT_dec_simple_void_NN ((SV *)ctx->coro);
357 ctx->coro = 0; 369 ctx->coro = 0;
358 } 370 }
359 X_UNLOCK (acquire_m); 371 X_UNLOCK (acquire_m);
360 372
361void 373void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines