Back to index

courier  0.68.2
Classes | Typedefs | Functions
nopthread.c File Reference
#include "threadlib.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Classes

struct  cthreadlock

Typedefs

typedef struct cthreadinfo

Functions

cthreadinfo_t * cthread_init (unsigned nthreads_, unsigned metasize, void(*workfunc_)(void *), void(*cleanupfunc_)(void *))
void cthread_wait (cthreadinfo_t *cit)

Class Documentation

struct cthreadlock

Definition at line 44 of file nopthread.c.

Class Members
int dummy
pthread_mutex_t mutex

Typedef Documentation

typedef struct cthreadinfo

Definition at line 14 of file nopthread.c.


Function Documentation

cthreadinfo_t* cthread_init ( unsigned  nthreads_,
unsigned  metasize,
void(*)(void *)  workfunc_,
void(*)(void *)  cleanupfunc_ 
) [read]

Definition at line 17 of file nopthread.c.

{
cthreadinfo_t *cit;

       if ((cit=(cthreadinfo_t *)malloc(sizeof(cthreadinfo_t))) == 0)
              return (0);

       cit->cleanupfunc=cleanupfunc_;
       cit->workfunc=workfunc_;

       if ( (cit->metadata_buf=malloc(metasize)) == 0)
       {
              free( (char *)cit );
              return (0);
       }
       return (cit);
}
void cthread_wait ( cthreadinfo_t *  cit)

Definition at line 37 of file nopthread.c.

{
       free(cit->metadata_buf);
       free( (char *)cit);
}