semaphore

semaphore

Synopsis

                    im_semaphore_t;
int                 im_semaphore_up                     (im_semaphore_t *s);
int                 im_semaphore_down                   (im_semaphore_t *s);
int                 im_semaphore_upn                    (im_semaphore_t *s,
                                                         int n);
int                 im_semaphore_downn                  (im_semaphore_t *s,
                                                         int n);
void                im_semaphore_destroy                (im_semaphore_t *s);
void                im_semaphore_init                   (im_semaphore_t *s,
                                                         int v,
                                                         char *name);

Description

Details

im_semaphore_t

typedef struct {
	char *name;
	int v;

	GMutex *mutex;
	GCond *cond;
} im_semaphore_t;

im_semaphore_up ()

int                 im_semaphore_up                     (im_semaphore_t *s);

im_semaphore_down ()

int                 im_semaphore_down                   (im_semaphore_t *s);

im_semaphore_upn ()

int                 im_semaphore_upn                    (im_semaphore_t *s,
                                                         int n);

im_semaphore_downn ()

int                 im_semaphore_downn                  (im_semaphore_t *s,
                                                         int n);

im_semaphore_destroy ()

void                im_semaphore_destroy                (im_semaphore_t *s);

im_semaphore_init ()

void                im_semaphore_init                   (im_semaphore_t *s,
                                                         int v,
                                                         char *name);