Back to index

php5  5.3.10
Functions | Variables
fpm_worker_pool.c File Reference
#include "fpm_config.h"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include "fpm.h"
#include "fpm_worker_pool.h"
#include "fpm_cleanup.h"
#include "fpm_children.h"
#include "fpm_shm.h"
#include "fpm_scoreboard.h"
#include "fpm_conf.h"

Go to the source code of this file.

Functions

static void fpm_worker_pool_cleanup (int which, void *arg)
struct fpm_worker_pool_sfpm_worker_pool_alloc ()
int fpm_worker_pool_init_main ()

Variables

struct fpm_worker_pool_sfpm_worker_all_pools

Function Documentation

Definition at line 41 of file fpm_worker_pool.c.

{
       struct fpm_worker_pool_s *ret;

       ret = malloc(sizeof(struct fpm_worker_pool_s));
       if (!ret) {
              return 0;
       }

       memset(ret, 0, sizeof(struct fpm_worker_pool_s));

       ret->idle_spawn_rate = 1;
       ret->log_fd = -1;
       return ret;
}

Here is the caller graph for this function:

static void fpm_worker_pool_cleanup ( int  which,
void *  arg 
) [static]

Definition at line 21 of file fpm_worker_pool.c.

{
       struct fpm_worker_pool_s *wp, *wp_next;

       for (wp = fpm_worker_all_pools; wp; wp = wp_next) {
              wp_next = wp->next;
              fpm_worker_pool_config_free(wp->config);
              fpm_children_free(wp->children);
              if ((which & FPM_CLEANUP_CHILD) == 0 && fpm_globals.parent_pid == getpid()) {
                     fpm_scoreboard_free(wp->scoreboard);
              }
              free(wp->config);
              free(wp->user);
              free(wp->home);
              free(wp);
       }
       fpm_worker_all_pools = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file fpm_worker_pool.c.

{
       if (0 > fpm_cleanup_add(FPM_CLEANUP_ALL, fpm_worker_pool_cleanup, 0)) {
              return -1;
       }
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 19 of file fpm_worker_pool.c.