#define PERL_THREAD_ALLOC_SPECIFIC(k) \
STMT_START {\
if((k = TlsAlloc()) == TLS_OUT_OF_INDEXES) {\
- PerlIO_printf(PerlIO_stderr(),"panic threads.xs: TlsAlloc");\
+ PerlIO_printf(PerlIO_stderr(), "panic threads.xs: TlsAlloc");\
exit(1);\
}\
} STMT_END
#define PERL_ITHR_JOINED 2
typedef struct ithread_s {
- struct ithread_s *next; /* next thread in the list */
- struct ithread_s *prev; /* prev thread in the list */
+ struct ithread_s *next; /* Next thread in the list */
+ struct ithread_s *prev; /* Prev thread in the list */
PerlInterpreter *interp; /* The threads interpreter */
- I32 tid; /* threads module's thread id */
- perl_mutex mutex; /* mutex for updating things in this struct */
- I32 count; /* how many SVs have a reference to us */
- signed char state; /* are we detached ? */
+ I32 tid; /* Threads module's thread id */
+ perl_mutex mutex; /* Mutex for updating things in this struct */
+ I32 count; /* How many SVs have a reference to us */
+ signed char state; /* Are we detached ? */
int gimme; /* Context of create */
SV* init_function; /* Code to run */
- SV* params; /* args to pass function */
+ SV* params; /* Args to pass function */
#ifdef WIN32
DWORD thr; /* OS's idea if thread id */
HANDLE handle; /* OS's waitable handle */
}
/*
- * iThread->create(); ( aka iThread->new() )
+ * ithread->create(); ( aka ithread->new() )
* Called in context of parent thread
*/
# endif
# ifdef THREAD_CREATE_NEEDS_STACK
if(pthread_attr_setstacksize(&attr, THREAD_CREATE_NEEDS_STACK))
- croak("panic: pthread_attr_setstacksize failed");
+ Perl_croak(aTHX_ "panic: pthread_attr_setstacksize failed");
# endif
#ifdef OLD_PTHREADS_API
PL_ptr_table = NULL;
}
- /* We have finished with it */
+ /* We are finished with it */
thread->state |= PERL_ITHR_JOINED;
MUTEX_UNLOCK(&thread->mutex);
thread->next = thread;
thread->prev = thread;
thread->interp = aTHX;
- thread->count = 1; /* imortal */
+ thread->count = 1; /* Immortal. */
thread->tid = tid_counter++;
known_threads++;
active_threads++;