Loading...
Searching...
No Matches
worker.h
/*
* Copyright 2011 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Daniel Kopecek <dkopecek@redhat.com>
*/
#ifndef WORKER_H
#define WORKER_H
#include "_seap.h"
#include <sexp.h>
#include <pthread.h>
#include "probe.h"
#ifndef PROBE_WORKER_DEFAULT_MAX_THREADS
# define PROBE_WORKER_DEFAULT_MAX_THREADS 64
#endif
#ifndef PROBE_WORKER_DEFAULT_MAX_CHDEPTH
# define PROBE_WORKER_DEFAULT_MAX_CHDEPTH 8
#endif
typedef struct {
SEAP_msgid_t sid;
pthread_t tid;
SEXP_t * (*msg_handler)(probe_t *, SEAP_msg_t *, int *);
SEAP_msg_t *msg;
} probe_worker_t;
typedef struct {
probe_t *probe;
probe_worker_t *pth;
} probe_pwpair_t;
probe_worker_t *probe_worker_new(void);
void *probe_worker_runfn(void *arg);
SEXP_t *probe_worker(probe_t *probe, SEAP_msg_t *msg_in, int *ret);
#endif /* WORKER_H */
probe_pwpair_t
Definition worker.h:45
probe_t
Definition probe.h:55
probe_worker_t
Definition worker.h:38
probe_worker_t::msg
SEAP_msg_t * msg
the message being handled
Definition worker.h:42
probe_worker_t::tid
pthread_t tid
thread ID
Definition worker.h:40
probe_worker_t::sid
SEAP_msgid_t sid
SEAP message handled by this thread.
Definition worker.h:39