# CreateSemaphore

Creates a semaphore.

### Synopsis

`Item CreateSemaphore( const char *name, uint8 pri )`

### Description

This convenience procedure creates a semaphore item with the specified name and priority. You can use this procedure in place of `CreateItem()` to create the semaphore.

For information about semaphores, which are used to control access to shared resources, see the Sharing System Resources chapter in the 3DO Portfolio Programmer's Guide.

### Arguments

name
  The name of the semaphore (see "Notes").

pri
  The priority of the semaphore; use 0 for now.

### Return Value

The procedure returns the item number of the semaphore or an error code if an error occurs.

### Implementation

Convenience call implemented in clib.lib V20.

### Associated Files

semaphore.h
  ANSI C Prototype

clib.lib
  ARM Link Library

### Notes

When you no longer need a semaphore, use `DeleteSemaphore()` to delete it.

You can use `FindSemaphore()` to find a semaphore by name. When creating semaphores, you should assign unique names whenever possible.

### See Also

``DeleteSemaphore`(), LockSemaphore(), UnlockSemaphore()`

#