Permalink
Browse files

using parent_perl's context instead of TLS

  • Loading branch information...
1 parent bb29ff1 commit 3650d5909b9cea82a13b82682474694b51ebb5f1 Tobias Leich committed Mar 19, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/Mixer/Music.xs
View
@@ -14,7 +14,7 @@ char *fcb = NULL;
void mix_func(void *udata, Uint8 *stream, int len)
{
- ENTER_TLS_CONTEXT;
+ PERL_SET_CONTEXT(parent_perl);
dSP; /* initialize stack pointer */
ENTER; /* everything created after here */
SAVETMPS; /* ...is a temporary variable. */
@@ -43,20 +43,18 @@ void mix_func(void *udata, Uint8 *stream, int len)
FREETMPS; /* free that return value */
LEAVE; /* ...and the XPUSHed "mortal" args. */
- LEAVE_TLS_CONTEXT;
}
void mix_finished(void)
{
- ENTER_TLS_CONTEXT;
+ PERL_SET_CONTEXT(parent_perl);
dSP; /* initialize stack pointer */
PUSHMARK(SP); /* remember the stack pointer */
if(fcb != NULL)
{
call_pv(fcb, G_DISCARD|G_VOID); /* call the function */
}
- LEAVE_TLS_CONTEXT;
}
#endif
@@ -140,7 +138,7 @@ mixmus_hook_music( func = NULL, arg = 0 )
CODE:
if(func != NULL)
{
- GET_TLS_CONTEXT;
+ parent_perl = PERL_GET_CONTEXT;
cb = func;
void *arg2 = safemalloc(sizeof(int));
*(int*) arg2 = arg;
@@ -160,7 +158,7 @@ mixmus_hook_music_finished( func = NULL )
CODE:
if(func != NULL)
{
- GET_TLS_CONTEXT;
+ parent_perl = PERL_GET_CONTEXT;
fcb = func;
Mix_HookMusicFinished(&mix_finished);
}

0 comments on commit 3650d59

Please sign in to comment.