in reply to PL_malloc_mutex in XS

Timeout.xs:12:29: error: ‘PL_malloc_mutex’ undeclared (first use in this function)

Is ‘PL_malloc_mutex’ one of those things that you're supposed to access as ‘&PL_malloc_mutex’ ?
At line 12 try:
if (pthread_mutex_trylock(&PL_malloc_mutex) == EBUSY) {
Cheers,
Rob

Replies are listed 'Best First'.
Re^2: PL_malloc_mutex in XS
by finisterra (Initiate) on Jul 15, 2014 at 11:15 UTC
    As far as I know, it is mutex, that is used in perl memory allocator.
    Of course, I want give a pointer on it to function pthread_mutex_trylock(), but this code doesn't work too:

    13 if (pthread_mutex_trylock(&PL_malloc_mutex) == EBUSY) {

    Timeout.xs: In function ‘XS_Timeout_try_get_mutex’:
    Timeout.xs:13:30: error: ‘PL_malloc_mutex’ undeclared (first use in this function)
    Timeout.xs:13:30: note: each undeclared identifier is reported only once for each function it appears in
      Hmmm ... yes, not a very intelligent suggestion on my part.

      Cheers,
      Rob