Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / apps / JAWS / clients / WebSTONE / src / nsapi-includes / base / sem.h
blob25072ee664b85f41a85cdcf5367521640f5dd9e3
1 /*
2 * Copyright (c) 1994, 1995. Netscape Communications Corporation. All
3 * rights reserved.
5 * Use of this software is governed by the terms of the license agreement for
6 * the Netscape Communications or Netscape Comemrce Server between the
7 * parties.
8 */
11 /* ------------------------------------------------------------------------ */
15 * sem.h: Attempt to provide multi-process semaphores across platforms
17 * Rob McCool
21 #ifndef SEM_H
22 #define SEM_H
24 #include "systems.h"
27 /* All of the implementations currently use int as the semaphore type */
28 #ifdef SEM_WIN32
29 typedef HANDLE SEMAPHORE;
30 #define SEM_ERROR 0
31 /* That oughta hold them (I hope) */
32 #define SEM_MAXVALUE 32767
34 #else /* ! SEM_WIN32 */
35 typedef int SEMAPHORE;
36 #define SEM_ERROR -1
37 #endif /* SEM_WIN32 */
40 * sem_init creates a semaphore using the given name and unique
41 * identification number. filename should be a file accessible to the
42 * process. Returns SEM_ERROR on error.
45 SEMAPHORE sem_init(char *name, int number);
48 * sem_terminate de-allocates the given semaphore.
51 void sem_terminate(SEMAPHORE id);
54 * sem_grab attempts to gain exclusive access to the given semaphore. If
55 * it can't get it, the caller will block. Returns -1 on error.
58 int sem_grab(SEMAPHORE id);
61 * sem_release releases this process's exclusive control over the given
62 * semaphore. Returns -1 on error.
65 int sem_release(SEMAPHORE id);
68 #endif