BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "bio.h"
#include "bu/log.h"
#include "bu/malloc.h"
#include "bu/parallel.h"
Include dependency graph for semaphore.c:

Go to the source code of this file.

Macros

#define SEMAPHORE_MAGIC   0x62757365
 
#define SEMAPHORE_MAX   1024
 

Functions

void bu_semaphore_init (unsigned int nsemaphores)
 
void bu_semaphore_free (void)
 
void bu_semaphore_acquire (unsigned int i)
 
void bu_semaphore_release (unsigned int i)
 

Detailed Description

semaphore implementation

Machine-specific routines for parallel processing. Primarily for handling semaphores to protect critical sections of code.

The new paradigm: semaphores are referred to, not by a pointer, but by a small integer. This module is now responsible for obtaining whatever storage is needed to implement each semaphore.

Note that these routines can't use bu_log() for error logging, because bu_log() acquires semaphore #0 (BU_SEM_SYSCALL).

Definition in file semaphore.c.

Macro Definition Documentation

#define SEMAPHORE_MAGIC   0x62757365

Definition at line 71 of file semaphore.c.

Referenced by bu_semaphore_acquire(), bu_semaphore_init(), and bu_semaphore_release().

#define SEMAPHORE_MAX   1024

Definition at line 72 of file semaphore.c.

Referenced by bu_semaphore_init().