source: trunk/include/earthworm_complex_funcs.h @ 5054

Revision 5027, 4.1 KB checked in by quintiliani, 5 years ago (diff)

Changed syntax for the following functions: CreateSpecificSemaphore_ew(), DestroySpecificSemaphore_ew(), PostSpecificSemaphore_ew(), WaitSpecificSemaphore_ew().
Since Mac OS X does not support unnamed semaphores, declared CreateSpecificNamedSemaphore_ew() and DestroySpecificNamedSemaphore_ew(), in place of the unnamed ones.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
3 *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
4 *
5 *    $Id$
6 *
7 *    Revision history:
8 *     $Log$
9 *     Revision 1.7  2007/03/28 14:13:39  paulf
10 *     minor MACOSX #ifdefs added
11 *
12 *     Revision 1.6  2004/10/19 22:41:18  mark
13 *     Removed thread priority functions (not ready for prime time yet...)
14 *
15 *     Revision 1.5  2004/10/07 21:30:28  mark
16 *     Added thread priority functions
17 *
18 *     Revision 1.4  2003/11/25 20:37:56  dietz
19 *     *** empty log message ***
20 *
21 *     Revision 1.3  2003/11/25 00:42:59  dietz
22 *     Fixed problem with StartThread prototypes. Need to use the thr_ret definition because
23 *     Solaris and Windows have different function returns!
24 *
25 *     Revision 1.2  2003/11/11 18:06:16  mark
26 *     Fixed compile bug for Visual C++ (need parameter names for StartThread functions)
27 *
28 *     Revision 1.1  2001/04/06 21:03:30  davidk
29 *     Initial revision
30 *
31 *
32 ************************************************************/
33
34#ifndef EARTHWORM_COMPLEX_FUNCS_H
35#define EARTHWORM_COMPLEX_FUNCS_H
36
37/* This file contains prototypes for earthworm libsrc
38   functions that require special type definitions, such as
39   (semaphores, threads, mutexes, sockets, etc.).
40
41   If you have functions that only use primitive types and you
42   do not need any extra header files for them to compile, then
43   you can put them into earthworm_simple_funcs.h.
44
45   Note, please try to keep functions from the same object
46   together in one section of one file.  So all of the sema_ew.c
47   stuff should go together.  Thank You!
48   Davidk 2001/04/06
49*************************************************************/
50
51/* System-dependent stuff goes here
52   ********************************/
53#include <platform.h>
54
55void CreateSemaphore_ew( void );            /* sema_ew.c    system-dependent */
56void PostSemaphore   ( void );              /* sema_ew.c    system-dependent */
57void WaitSemPost     ( void );              /* sema_ew.c    system-dependent */
58void DestroySemaphore( void );              /* sema_ew.c    system-dependent */
59#ifndef _MACOSX
60sema_t *CreateSpecificSemaphore_ew( unsigned int count ); /* sema_ew.c    system-dependent */
61void   DestroySpecificSemaphore_ew  ( sema_t * );           /* sema_ew.c    system-dependent */
62#else
63sema_t *CreateSpecificNamedSemaphore_ew( char *sem_name,
64                      unsigned int count ); /* sema_ew.c    system-dependent */
65void   DestroySpecificNamedSemaphore_ew( char *sem_name,  sema_t *ms );
66                                            /* sema_ew.c    system-dependent */
67#endif
68void PostSpecificSemaphore_ew  ( sema_t * );              /* sema_ew.c    system-dependent */
69void WaitSpecificSemaphore_ew  ( sema_t * );              /* sema_ew.c    system-dependent */
70
71void CreateMutex_ew  ( void );              /* sema_ew.c    system-dependent */
72void RequestMutex( void );                  /* sema_ew.c    system-dependent */
73void ReleaseMutex_ew( void );               /* sema_ew.c    system-dependent */
74void CloseMutex( void );                    /* sema_ew.c    system-dependent */
75void CreateSpecificMutex( mutex_t * );
76void CloseSpecificMutex( mutex_t * );
77void RequestSpecificMutex( mutex_t * );
78void ReleaseSpecificMutex( mutex_t * );
79
80                                            /* sendmail.c   system-dependent */
81void SocketSysInit( void   );               /* socket_ew.c  system-dependent */
82void SocketClose  ( int    );               /* socket_ew.c  system-dependent */
83void SocketPerror ( char * );               /* socket_ew.c  system-dependent */
84int sendall( int, const char *, long, int );/* socket_ew.c  system-dependent */
85
86int  WaitThread( unsigned * );              /* threads_ew.c system-dependent */
87int  KillThread( unsigned int );            /* threads_ew.c system-dependent */
88int  KillSelfThread( void );                /* threads_ew.c system-dependent */
89int  StartThread( thr_ret fun(void *), unsigned stack_size, unsigned *thread_id );
90int  StartThreadWithArg( thr_ret fun(void *), void *arg, unsigned stack_size, unsigned *thread_id );
91
92#endif /* EARTHWORM_COMPLEX_FUNCS_H */
Note: See TracBrowser for help on using the repository browser.