~arges/ubuntu/quantal/rsyslog/fix-lp1059592

« back to all changes in this revision

Viewing changes to threads.h

Tags: 5.7.3-1
* New upstream release.
* Upload to unstable.
* debian/patches/02-typo_fix_equation_sign.patch
  - Removed, merged upstream.
* debian/patches/03-atomic_operations.patch
  - Removed, merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
/* the thread object */
27
27
struct thrdInfo {
28
 
        pthread_mutex_t *mutTermOK;     /* Is it ok to terminate that thread now? */
 
28
        pthread_mutex_t mutThrd;/* mutex for handling long-running operations and shutdown */
 
29
        pthread_cond_t condThrdTerm;/* condition: thread terminates (used just for shutdown loop) */
29
30
        int bIsActive;          /* Is thread running? */
30
31
        int bShallStop;         /* set to 1 if the thread should be stopped ? */
31
32
        rsRetVal (*pUsrThrdMain)(struct thrdInfo*); /* user thread main to be called in new thread */
32
33
        rsRetVal (*pAfterRun)(struct thrdInfo*);   /* cleanup function */
33
34
        pthread_t thrdID;
 
35
        sbool bNeedsCancel;     /* must input be terminated by pthread_cancel()? */
34
36
};
35
37
 
36
38
/* prototypes */
38
40
rsRetVal thrdInit(void);
39
41
rsRetVal thrdTerminate(thrdInfo_t *pThis);
40
42
rsRetVal thrdTerminateAll(void);
41
 
rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *));
42
 
rsRetVal thrdSleep(thrdInfo_t *pThis, int iSeconds, int iuSeconds);
 
43
rsRetVal thrdCreate(rsRetVal (*thrdMain)(thrdInfo_t*), rsRetVal(*afterRun)(thrdInfo_t *), sbool);
43
44
 
44
45
/* macros (replace inline functions) */
45
46