~ubuntu-branches/ubuntu/karmic/rsyslog/karmic

« back to all changes in this revision

Viewing changes to runtime/wti.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-04-08 00:59:14 UTC
  • mfrom: (1.1.9 upstream) (3.2.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090408005914-gfyay7o45szt05zl
Tags: 3.20.5-1
* New upstream release.
* debian/rsyslog.logcheck.ignore.server
  - Install a logcheck ignore file for rsyslog (using dh_installlogcheck).
    Thanks to Kim Holviala for the patch. Closes: #522164

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Definition of the worker thread instance (wti) class.
 
2
 *
 
3
 * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
 
4
 *
 
5
 * This file is part of the rsyslog runtime library.
 
6
 *
 
7
 * The rsyslog runtime library is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU Lesser General Public License as published by
 
9
 * the Free Software Foundation, either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * The rsyslog runtime library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public License
 
18
 * along with the rsyslog runtime library.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * A copy of the GPL can be found in the file "COPYING" in this distribution.
 
21
 * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
 
22
 */
 
23
 
 
24
#ifndef WTI_H_INCLUDED
 
25
#define WTI_H_INCLUDED
 
26
 
 
27
#include <pthread.h>
 
28
#include "wtp.h"
 
29
#include "obj.h"
 
30
 
 
31
/* the worker thread instance class */
 
32
typedef struct wti_s {
 
33
        BEGINobjInstance;
 
34
        pthread_t thrdID;  /* thread ID */
 
35
        qWrkCmd_t tCurrCmd; /* current command to be carried out by worker */
 
36
        obj_t *pUsrp;           /* pointer to an object meaningful for current user pointer (e.g. queue pUsr data elemt) */
 
37
        wtp_t *pWtp; /* my worker thread pool (important if only the work thread instance is passed! */
 
38
        pthread_cond_t condInitDone; /* signaled when the thread startup is done (once per thread existance) */
 
39
        pthread_cond_t condExitDone; /* signaled when the thread exit is done (once per thread existance) */
 
40
        pthread_mutex_t mut;
 
41
        int bShutdownRqtd;      /* shutdown for this thread requested? 0 - no , 1 - yes */
 
42
        uchar *pszDbgHdr;       /* header string for debug messages */
 
43
} wti_t;
 
44
 
 
45
/* some symbolic constants for easier reference */
 
46
 
 
47
 
 
48
/* prototypes */
 
49
rsRetVal wtiConstruct(wti_t **ppThis);
 
50
rsRetVal wtiConstructFinalize(wti_t *pThis);
 
51
rsRetVal wtiDestruct(wti_t **ppThis);
 
52
rsRetVal wtiWorker(wti_t *pThis);
 
53
rsRetVal wtiProcessThrdChanges(wti_t *pThis, int bLockMutex);
 
54
rsRetVal wtiSetDbgHdr(wti_t *pThis, uchar *pszMsg, size_t lenMsg);
 
55
rsRetVal wtiSetState(wti_t *pThis, qWrkCmd_t tCmd, int bActiveOnly, int bLockMutex);
 
56
rsRetVal wtiJoinThrd(wti_t *pThis);
 
57
rsRetVal wtiCancelThrd(wti_t *pThis);
 
58
qWrkCmd_t wtiGetState(wti_t *pThis, int bLockMutex);
 
59
PROTOTYPEObjClassInit(wti);
 
60
PROTOTYPEpropSetMeth(wti, pszDbgHdr, uchar*);
 
61
PROTOTYPEpropSetMeth(wti, pWtp, wtp_t*);
 
62
 
 
63
#endif /* #ifndef WTI_H_INCLUDED */