1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/*
* Copyright (c) 2000 Charles Ying. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the same terms as perl itself.
*
* Please note that this code falls under a different license than the
* other code found in Sendmail::Milter.
*
*/
#ifndef __INTPOOLS_H_
#define __INTPOOLS_H_
struct interp_t
{
PerlInterpreter *perl;
void *cache;
int requests;
};
typedef struct interp_t interp_t;
struct intpool_t
{
pthread_mutex_t ip_mutex;
pthread_cond_t ip_cond;
PerlInterpreter *ip_parent;
int ip_max;
int ip_retire;
int ip_busycount;
AV* ip_freequeue;
};
typedef struct intpool_t intpool_t;
extern void init_interpreters(intpool_t *, int, int);
extern void cleanup_interpreters(intpool_t *);
extern interp_t *lock_interpreter(intpool_t *);
extern void unlock_interpreter(intpool_t *, interp_t *);
extern interp_t *create_interpreter(intpool_t *);
extern void cleanup_interpreter(intpool_t *, interp_t *);
extern void alloc_interpreter_cache(interp_t *interp, size_t size);
extern void free_interpreter_cache(interp_t *interp);
extern int test_intpools(pTHX_ int, int, int, int, SV*);
#endif /* __INTPOOLS_H_ */
|