A generic method and apparatus for managing semaphores in a multi-threaded
processing system has a storage area for each of the threads in the
processing system. Each storage area includes a first part for storing at
least one indicia for identifying at least one unique semaphore from a
plurality of semaphores utilized by the multi-threaded processing system
and a second part for storing an indicia for indicating a locked status
for the stored semaphore. A thread requiring a semaphore sends a
semaphore lock request to the semaphore manager which examines the
contents of all of the storage areas to determine the status of the
requested semaphore. If the requested semaphore is not locked, it is
locked for the requesting thread by inserting the requested semaphore and
locked status in the memory location assigned to the requesting thread.